Log sql command before it is executed instead of after
In the execute_sql function, logger.debug((sql, params)) is called after the sql command is executed.

Why not call it before so that if the sql command raises an exception the exact command that was executed has already been logged? This makes things easier to debug.
