Skip to content

Instantly share code, notes, and snippets.

@jido
Forked from LauJensen/gist:d835630aff8313980813
Created November 3, 2010 10:00
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 jido/559c305e432ff0b0e41e to your computer and use it in GitHub Desktop.
Save jido/559c305e432ff0b0e41e to your computer and use it in GitHub Desktop.
(where) = selection condition
{} = Key/val... 'k=v'
[] = 'this OR that'
clojureql.internal> (compile (where {:rank "Top"}))
"rank=Top"
clojureql.internal> (compile (where {:rank "Top"} {:title "Dev"}))
"rank=Top AND title=Dev"
clojureql.internal> (compile (where {:rank "Top"} [{:id 5} {:title "Dev"}]))
"rank=Top AND (title=Dev OR id=5)"
clojureql.internal> (compile (where [{:rank "Top"} {:id 5}]))
"(rank=Top OR id=5)"
clojureql.internal> (compile (where [{:rank "Top"} {:id 5 :title "Dev"}])
"rank=Top OR (title=Dev AND id=5)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment