IreneKnapp/direct-sqlite — pull request #23 by nurpax (2013-01-06 16:24:11+00:00)
Title: Add sqlite3_sql & debug trace support

As discussed in https://github.com/IreneKnapp/direct-sqlite/pull/22, here's my PR for adding tracing support. I think this is a very useful feature for debugging. If you read the comments, you will see that there's some amount of unsafety involved.

There's also a minor memory leak in there. When setting a log function with `setTrace`, a single Haskell FunPtr is leaked.. I thought it's not really a big deal, since this function is probably only called once per application invocation. If you want to get rid of it, you'd need to add a ref to the Connection object, which would need a lot more changes for close to zero !/$.

This functionality is exposed through only Database.SQLite3.Bindings and *.Direct, but not via Database.SQLite3. Database.SQLite3 will be easier to add later if necessary.

@joeyadams You wanted to be pinged for code review.. Here you go!