fakeExec captures Exec calls for assertion without touching a DB. `err` (if set) is returned on every call. `errOnContains` (if set) is returned only on calls whose SQL contains the substring — used to exercise selective failure modes like "pg_notify fails but the INSERT succeeds."
| 61 | // to exercise selective failure modes like "pg_notify fails but the |
| 62 | // INSERT succeeds." |
| 63 | type fakeExec struct { |
| 64 | calls []string |
| 65 | args [][]any |
| 66 | err error |
| 67 | errOnContains string |
| 68 | errSelective error |
| 69 | } |
| 70 | |
| 71 | func (f *fakeExec) Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error) { |
| 72 | f.calls = append(f.calls, sql) |
nothing calls this directly
no outgoing calls
no test coverage detected