1. Shantanu Kumar
  2. SQLRat

Commits

kumarshantanu  committed d801f4f

complete the tutorial for 0.1 release
edit CHANGES to reflect future :groupby and :orderby arguments
prevent compilation to .class files only

  • Participants
  • Parent commits 62c11d5
  • Branches default

Comments (0)

Files changed (3)

File CHANGES

View file
 
 - [TODO] Optimistic locks using time stamps
 - [TODO] DSL for the WHERE clause
+- [????] Provide :groupby and :orderby arguments to find-xxx functions
 
 ## 0.1 / ????
 

File README

View file
 * one-to-one-depends (THAT entity is dependent upon THIS)
 * one-to-one
 
-and each of them take the following parameters:
+and each of them take the following parameters (where THIS means the current
+entity-type/table and THAT means the related entity-type/table):
 
 * this-col (column in THIS entity)
 * that-ent-meta (THAT entity meta data)
 
 ### Retrieve entities
 
+Retrieving entities involves find-by-id and find-by-criteria functions, which
+can be used as follows:
+
+<script src="http://gist.github.com/558419.js"> </script>
+
 ### Count entities
 
+Retrieving count of records is same as using the find-by-criteria function, but
+specifying "count-col" as the chosen column.
+
+To read the count, you can use the function read-count-col.
+
+<script src="http://gist.github.com/558428.js"> </script>
+
 ### Save dependent entities (Update/Insert)
 
-### Retrieve relation entities
+Dependent entities can be saved using the save-deps function, where it
+automatically populates the foreign key in the dependent records.
 
-### Count relation entities
+<script src="http://gist.github.com/558449.js"> </script>
 
-### Delete entities
+### Retrieve/Count relation entities
 
-### Delete cascaded (dependent entities)
+Related entities can be fetched using the find-rels function, which avoids "N+1
+Selects" while querying the database. Counting the relation entities is as easy
+as specifying the ":cols count-col" parameter and read them back using the
+read-count-col function. The count operation automatically adds GROUP BY clause
+to the SQL.
+
+<script src="http://gist.github.com/558467.js"> </script>
+
+### Retrieve/Count sibling entities
+
+Singling entities can be fetches using the find-siblings function. As in other
+find-** functions, you can pass :cols and :where arguments and count records as
+well.
+
+<script src="http://gist.github.com/558488.js"> </script>
+
+### Delete/Delete-cascade entities
+
+The delete function is used to delete an entity. Similarly, the delete-cascade
+function is used to delete the entire parent-child tree of entities.
+
+<script src="http://gist.github.com/558500.js"> </script>

File pom.xml

View file
         </executions>
         <configuration>
           <clojureOptions>-Dbasedir=${basedir}</clojureOptions>
+          <compileDeclaredNamespaceOnly>true</compileDeclaredNamespaceOnly>
           <sourceDirectories>
             <sourceDirectory>src/main/clj</sourceDirectory>
           </sourceDirectories>