Skip to content

Instantly share code, notes, and snippets.

@kumarshantanu
Created August 31, 2010 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumarshantanu/558419 to your computer and use it in GitHub Desktop.
Save kumarshantanu/558419 to your computer and use it in GitHub Desktop.
(in-db db
(let [e1 (find-by-id blog-entry-meta 1)
ea (find-by-criteria blog-entry-meta) ;; finds all records
ec (find-by-criteria blog-entry-meta :cols [:title :content])
ew (find-by-criteria blog-entry-meta :where ["title=?" "Hello World"])
eb (find-by-criteria blog-entry-meta :cols [:title :content] :where ["title LIKE ?" "Hello%"])]
(ppe "Entry 1:" e1)
(ppe "All Entries:" ea)
(ppe "Entries with selected columns:" ec)
(ppe "Entries with WHERE clause:" ew)
(ppe "Entries with selected columns and WHERE clause:" eb)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment