()
| 51 | }; |
| 52 | |
| 53 | const makeSql = (): Sql => |
| 54 | postgres(resolveConnectionString(), { |
| 55 | // max=1 is correct for Hyperdrive: one request, one connection. The |
| 56 | // earlier deadlock under ctx.transaction (outer sql.begin holding the |
| 57 | // only connection while nested writes pulled fresh ones) is fixed in |
| 58 | // @executor-js/sdk — nested writes now thread through the active FumaDB tx |
| 59 | // handle, so they reuse the same connection and never contend with the |
| 60 | // outer sql.begin. |
| 61 | max: 1, |
| 62 | idle_timeout: 0, |
| 63 | max_lifetime: 60, |
| 64 | connect_timeout: 10, |
| 65 | fetch_types: false, |
| 66 | prepare: true, |
| 67 | onnotice: () => undefined, |
| 68 | }); |
| 69 | |
| 70 | /** |
| 71 | * Graceful drain window (seconds) handed to `postgres`'s `sql.end`. Small but |
no test coverage detected