On Oct 31, 4:40 pm, Shantanu Kumar <
kumar.shant...@gmail.com> wrote:
> Yes, even the boolean flag should be enough. The important part is it should
> cover all kinds of queries -- SELECT, INSERT, UPDATE, CREATE TABLE....etc.
>
I've looked at this and, while possible, it does mean that clj-sql
would need to implement all functions that handle sql in
clojure.contrib.sql. Currently it just captures part of the
clojure.contrib.sql for most functionality. I'm not opposed to
wrapping clojure.contrib.sql functions but I'm keen to avoid it where
possible.
In this case there may be an easier solution. Both clojure.contrib.sql
and clj-sql support passing a javax.sql.Datasource in the database
spec. This object allows a PrintWriter to be set which usually logs
SQL and the creation of connections etc.
http://download.oracle.com/javase/1.4.2/docs/api/javax/sql/DataSource.html#setLogWriter%28java.io.PrintWriter%29
(.setLogWriter my-datasource (PrintWriter. *out*))
H2 ignores this call but Apache Derby should log fine.
Let me know if this is good enough - if not I'll go ahead and wrap the
contrib functions.
Saul