-
I'm trying to figure out if it is possible to log all database queries, I haven't found any documentation regarding bob & logging. Is this something that is supported? if not, how could I get around this limitation? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can wrap your executor with a debug executor (or your own implementation): exec = bob.Debug(exec) There is also |
Beta Was this translation helpful? Give feedback.
-
You could also use a sqlDB = sqldblogger.OpenDriver(...)
db := bob.NewDB(sqlDB) or if you use a different driver it may have something in store for you like e.g. https://github.com/jackc/pgx with https://pkg.go.dev/github.com/jackc/pgx/v5#hdr-Tracing_and_Logging |
Beta Was this translation helpful? Give feedback.
You could also use a
database/sql
wrapper like https://github.com/simukti/sqldb-loggeror if you use a different driver it may have something in store for you like e.g. https://github.com/jackc/pgx with https://pkg.go.dev/github.com/jackc/pgx/v5#hdr-Tracing_and_Logging