Hey Sean,

maybe you could clarify some choices made in 0.3, I needed to rewrite some 
SQL bits of my app anyhow and thought it was a good time to ditch 0.2.3 as 
well.

1) Why the keyword args to most functions? entities/identifiers in 
particular. My SQL Tables have columns like "created_at", "created_by", 
since SQL doesnt like "-" as separators, I still want to use "-" in Clojure 
so on insert I do

(j/insert! db table {:created-by 1, :name "test"} :entities #(str/replace % 
#"-" "_"))

All is fine until I want to use the return value of insert (aka the 
inserted record + the generated id) which then equals

{:created_by 1, :name "test", :id 1} notice the "incorrect" underscore.

In my case it would be sufficient if I could use the db map to specify this 
behavior, and one could still override this by just doing

(j/insert! (assoc db :identifiers some-fn) table record). I realize that db 
is a "Connectable" and not always a map, but since its forced to a map 
under the hood anyways why not force it outside too.

2) Transaction Management? I dont quite understand what the point of the 
":transaction?" option is since you should be able to infer this 
information at runtime? Seems to basically duplicate what 
Connection.setAutoCommit already does?


Apart from these issues the API looks a lot nicer.

Regards,
/thomas



On Saturday, May 4, 2013 5:58:11 PM UTC+2, Sean Corfield wrote:
>
> Thanx for the detailed feedback. I'm not sure why that didn't show up 
> in testing. Update made to create alpha3. I'll have it released to 
> Maven shortly. 
>
> On Sat, May 4, 2013 at 3:51 AM, r0man 
> <roman....@burningswell.com<javascript:>> 
> wrote: 
> > Hi Sean, 
> > 
> > I just tested java.jdbc 0.3.0-alpha2 against my code base and got 
> > the following excpetion when running my tests: 
> > 
> > Exception in thread "main" java.lang.IllegalArgumentException: Unable to 
> > resolve classname: Connection, 
> > 
> > I think the problem only happens when you use the get-connection 
> > function in a macro, and the java.sql.Connection class was not 
> > already imported. 
> > 
> > The problem could be fixed by adding the fully qualified type 
> > hint java.sql.Connection instead of just Connection to 
> > get-connection. Could you please change this? 
> > 
> > Thanks, Roman. 
> > 
> > On Saturday, May 4, 2013 2:32:37 AM UTC+2, Sean Corfield wrote: 
> >> 
> >> Another step toward the 0.3.0 release for Clojure's JDBC wrapper. A 
> >> very minor update, mostly bug fixes and consistency issues. Based on 
> >> feedback from some users, the new boolean transaction? argument in 
> >> some of the new API functions will probably change in alpha3 although 
> >> that's not fully decided yet. Watch this space. 
> >> 
> >> Release 0.3.0-alpha2 on 2013-05-03 
> >> 
> >> Address JDBC-51 by declaring get-connection returns java.sql.Connection 
> >> Add IResultSetReadColumn protocol extension point for custom read 
> >> conversions JDBC-46 
> >> Add :multi? to execute! so it can be used for repeated operations 
> JDBC-52 
> >> Reverted specialized handling of NULL values (reopens JDBC-40) 
> >> Rename :as-arrays to :as-arrays? since it is boolean 
> >> Add curried version of clojure.java.jdbc.sql/as-quoted-str 
> >> Officially deprecate resultset-seq 
> >> 
> >> For more details about past releases: 
> https://github.com/clojure/java.jdbc 
> >> -- 
> >> Sean A Corfield -- (904) 302-SEAN 
> >> An Architect's View -- http://corfield.org/ 
> >> World Singles, LLC. -- http://worldsingles.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 clo...@googlegroups.com<javascript:> 
> > Note that posts from new members are moderated - please be patient with 
> your 
> > first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com <javascript:> 
> > 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+u...@googlegroups.com <javascript:>. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>
>
> -- 
> Sean A Corfield -- (904) 302-SEAN 
> An Architect's View -- http://corfield.org/ 
> World Singles, LLC. -- http://worldsingles.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
--- 
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/groups/opt_out.


Reply via email to