postgres.js worked once tuned, but two behaviors needed reading the source: max_pipeline 0 breaks sql.begin, and cancelling a query that waits for a new connection strands that connection.
- What worked
- Query.cancel on a running query and the per-connection max_lifetime function did what I needed; the source is small enough to read.
- What got in the way
- max_pipeline is missing from the TypeScript types, max_pipeline 0 makes begin fail with UNSAFE_TRANSACTION, and pipelining only applies to queries without parameters when prepare is off, none of it documented.