ExecContext logs its params and calls the underlying driver ExecContext method if it is supported.
(ctx context.Context, query string, args ...any)
| 40 | |
| 41 | // ExecContext logs its params and calls the underlying driver ExecContext method if it is supported. |
| 42 | func (d *DebugDriver) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error) { |
| 43 | drv, ok := d.Driver.(interface { |
| 44 | ExecContext(context.Context, string, ...any) (sql.Result, error) |
| 45 | }) |
| 46 | if !ok { |
| 47 | return nil, fmt.Errorf("Driver.ExecContext is not supported") |
| 48 | } |
| 49 | if skip, ok := ctx.Value(SkipDbLogging{}).(bool); ok && skip { |
| 50 | return drv.ExecContext(ctx, query, args...) |
| 51 | } |
| 52 | d.log(ctx, fmt.Sprintf("driver.ExecContext: query=%v args=%v", query, args)) |
| 53 | return drv.ExecContext(ctx, query, args...) |
| 54 | } |
| 55 | |
| 56 | // Query logs its params and calls the underlying driver Query method. |
| 57 | func (d *DebugDriver) Query(ctx context.Context, query string, args, v any) error { |
nothing calls this directly
no test coverage detected