(ctx context.Context, query string, args ...any)
| 111 | } |
| 112 | |
| 113 | func (c *Client) exec(ctx context.Context, query string, args ...any) error { |
| 114 | r, err := c.db.ExecContext(ctx, query, args...) |
| 115 | if c.spec.Debug { |
| 116 | logEvent := c.logger.Debug().Str("query", query).Any("values", args) |
| 117 | if err != nil { |
| 118 | logEvent.Err(err).Msg("exec query") |
| 119 | } else { |
| 120 | rowsAffected, rowsErr := r.RowsAffected() |
| 121 | logEvent.Int64("rowsAffected", rowsAffected).Err(rowsErr).Msg("exec query") |
| 122 | } |
| 123 | } |
| 124 | return err |
| 125 | } |
| 126 | |
| 127 | func amendConnectionString(s string) string { |
| 128 | if !strings.HasPrefix(s, "md:") { |
no outgoing calls
no test coverage detected