Commit df8938a
feat(graphile-test): add withTransaction to pgClient in test context
In production, @dataplan/pg provides withTransaction on the pgClient.
In tests, the raw pg Client lacks it, causing plugins that call
pgClient.withTransaction() (e.g. graphile-presigned-url-plugin) to fail
unless tests manually monkey-patch the method.
This adds a savepoint-based withTransaction implementation to the client
inside the withPgClient callback. Savepoints nest cleanly inside the
test harness's outer transaction, matching production behavior.
Eliminates the need for per-test monkey patches.1 parent 8b46d44 commit df8938a
1 file changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
274 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
275 | 295 | | |
276 | 296 | | |
277 | 297 | | |
| |||
0 commit comments