This post originated from an RSS feed registered with Ruby Buzz
by john hume.
Original Post: Fancy Queries for clj-record
Feed Title: El Humidor
Feed URL: http://feeds.feedburner.com/ElHumidor
Feed Description: John D. Hume on Ruby and development with agile teams.
Thanks to another contribution from Tunde Ashafa, clj-record now has support for more advanced queries using functions in the new clj-record.query namespace.
Previously you could do this:
(manufacturer/find-records{:grade98}); or
(manufacturer/find-records{:name"Humedai Motors"})
Now you can do this:
; having required [clj-record.query :as q]
(manufacturer/find-records{:grade(q/greater-than90)}); or
(manufacturer/find-records{:name(q/like"Hume%")})
See the tests for more examples of what it does. See the source for how it's implemented. And please: recommend improvements.