Better logging, pass client around.
Go back to a separate connect/query API.
Make sure to release connections on error.