Re: clojure.java.jdbc prepared select statement

2015-11-09 Thread Sean Corfield
In no way did I want to criticize your awesome library None taken! I'll see if I can expand on the documentation. Thank you! I’m not great at documentation, never have been (one of my first jobs, they hired a technical writer to turn my attempt at documentation into something usable…), so I’m

Re: clojure.java.jdbc prepared select statement

2015-11-09 Thread Niels van Klaveren
Thanks for the explanation Sean, that makes a whole lot more sense to me now. I knew I had to miss something when I saw query would also accept prepared statements! In no way did I want to criticize your awesome library, and I'll see if I can expand on the documentation. The use of prepared sta

Re: clojure.java.jdbc prepared select statement

2015-11-09 Thread Sean Corfield
Niels van Klaveren wrote on Monday, November 9, 2015 at 7:20 AM: OK, so after some more experimentation I found out I needed to do the get-connection in the prepare-statement instead of the with-db-connection binding. A bit counter-intuitive, and I hope it will still work when a connection pool

Re: clojure.java.jdbc prepared select statement

2015-11-09 Thread Niels van Klaveren
Performance wise the conclusion is batch queries done this way are around 60% faster than doing separate queries for even very simple queries. On Monday, November 9, 2015 at 11:45:48 AM UTC+1, Niels van Klaveren wrote: > > While answering this question >

Re: clojure.java.jdbc prepared select statement

2015-11-09 Thread Niels van Klaveren
OK, so after some more experimentation I found out I needed to do the get-connection in the prepare-statement instead of the with-db-connection binding. A bit counter-intuitive, and I hope it will still work when a connection pool is used. (j/with-db-connection [c datasource]

clojure.java.jdbc prepared select statement

2015-11-09 Thread Niels van Klaveren
While answering this question on stackoverflow about do-prepared I wanted to show the way to do multiple queries with the same prepared statement (bat