What? Clojure contrib wrapper for JDBC https://github.com/clojure/java.jdbc#change-log
The 0.6.0 Alpha builds have been out for a couple of weeks and we have Alpha 2 in production at World Singles. I’ve received no reports of problems with the new API so I’m declaring Release Candidate 1. This is functionally identical to Alpha 2, with the additional of two convenience functions, adapted from very common usage at World Singles, which make sense to add to core now that the API has changed to make options a single map: clojure.java.jdbc/get-by-id ([db table pk-value] [db table pk-value pk-name-or-opts] [db table pk-value pk-name opts]) Given a database connection, a table name, a primary key value, an optional primary key column name, and an optional options map, return a single matching row, or nil. The primary key column name defaults to :id. clojure.java.jdbc/find-by-keys ([db table columns] [db table columns opts]) Given a database connection, a table name, a map of column name/value pairs, and an optional options map, return any matching rows. These cover two very common use cases that you would otherwise have to write trivial boilerplate SQL for. I am _considering_ adding ORDER BY functionality to find-by-keys for release but I’m not sure of the best syntax. What we have at World Singles is a vector of either column names or single-element maps from column names to orders: [:foo {:bar :desc} {:quux :asc}] so :foo is equivalent to {:foo :asc} but that’s a little bulky for a single descending key: [{:foo :desc}] Perhaps a simple vector of column name direction pairs? You’d have to specify direction tho’: [:foo :asc :bar :desc :quux :asc] For a single column: [:foo :asc] Although there would be no ambiguity between a single (ascending) column name – either a string or keyword – and an order vector: (find-by-keys db-spec :table example-map {:order-by :foo}) (find-by-keys db-spec :table example-map {:order-by [:foo :desc]}) (find-by-keys db-spec :table example-map {:order-by [:foo :asc :bar :desc]}) Sean Corfield -- (904) 302-SEAN World Singles -- http://worldsingles.com/ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.