Query logs its params and calls the underlying transaction Query method.
(ctx context.Context, query string, args, v any)
| 151 | |
| 152 | // Query logs its params and calls the underlying transaction Query method. |
| 153 | func (d *DebugTx) Query(ctx context.Context, query string, args, v any) error { |
| 154 | start := time.Now() |
| 155 | err := d.Tx.Query(ctx, query, args, v) |
| 156 | if skip, ok := ctx.Value(SkipDbLogging{}).(bool); ok && skip { |
| 157 | return err |
| 158 | } |
| 159 | d.log(ctx, fmt.Sprintf("Tx(%s).Query: query=%v args=%v time=%v", d.id, query, args, time.Since(start))) |
| 160 | return err |
| 161 | } |
| 162 | |
| 163 | // QueryContext logs its params and calls the underlying transaction QueryContext method if it is supported. |
| 164 | func (d *DebugTx) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error) { |
no test coverage detected