@@ -54,27 +54,27 @@ func (d *DB) Query(query string, args ...interface{}) (*sql.Rows, error) {
5454}
5555
5656func (d * DB ) QueryRow (query string , args ... interface {}) * sql.Row {
57- d .logQuery (time .Now (), "QueryRow" , query , args ... )
57+ defer d .logQuery (time .Now (), "QueryRow" , query , args ... )
5858 return d .DB .QueryRow (query , args ... )
5959}
6060
6161func (d * DB ) QueryRowContext (ctx context.Context , query string , args ... interface {}) * sql.Row {
62- d .logQuery (time .Now (), "QueryRowContext" , query , args ... )
62+ defer d .logQuery (time .Now (), "QueryRowContext" , query , args ... )
6363 return d .DB .QueryRowContext (ctx , query , args ... )
6464}
6565
6666func (d * DB ) Exec (query string , args ... interface {}) (sql.Result , error ) {
67- d .logQuery (time .Now (), "Exec" , query , args ... )
67+ defer d .logQuery (time .Now (), "Exec" , query , args ... )
6868 return d .DB .Exec (query , args ... )
6969}
7070
7171func (d * DB ) ExecContext (ctx context.Context , query string , args ... interface {}) (sql.Result , error ) {
72- d .logQuery (time .Now (), "ExecContext" , query , args ... )
72+ defer d .logQuery (time .Now (), "ExecContext" , query , args ... )
7373 return d .DB .ExecContext (ctx , query , args ... )
7474}
7575
7676func (d * DB ) Prepare (query string ) (* sql.Stmt , error ) {
77- d .logQuery (time .Now (), "Prepare" , query )
77+ defer d .logQuery (time .Now (), "Prepare" , query )
7878 return d .DB .Prepare (query )
7979}
8080
0 commit comments