On Tue, Apr 26, 2011 at 10:13 AM, Sean Corfield <seancorfi...@gmail.com> wrote:
> I think at this point it makes sense to add a function to c.j.j that
> mimics the current resultset-seq functionality but allows for the
> application of naming strategies - with the default being the current
> behavior, and some other standard strategies available.

This is done - along with all the options for quoting and naming
strategies. Thanx to Nicolas Buduroi for helpful pointers along the
way!

I've added some nascent documentation (which will ultimately show up
here http://clojure.github.com/java.jdbc/ but can be seen directly in
github here 
https://github.com/clojure/java.jdbc/tree/master/doc/clojure/java/jdbc
right now).

> The question then is whether the c.j.j function should also be called
> resultset-seq or whether a new name should be picked?

For now, c.j.j.internal/resultset-seq* is the name used (by c.j.j
itself) so the question still remains as to whether c.j.j should
expose it publicly - either as resultset-seq or as a new name.

The default behavior is unchanged but this new version respects the
naming strategy specified so you can control exactly how SQL entity
names are mapped to keywords and vice versa.

Please read this page for specifics:
https://github.com/clojure/java.jdbc/blob/master/doc/clojure/java/jdbc/NameMapping.md

Note in particular that passing "strings" into c.j.j means no
translation, only :keywords are translated when passed in. However,
resultset-seq* still always converts entity names to keywords (so that
the resulting maps are easy to work with. You can use
(with-naming-strategy { :keyword identity } ...) to override the
lowercasing and then, if you wish, a simple (map name ...) over the
returned maps will get you the original entity names back.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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

Reply via email to