Repository navigation
4.5.0
@steadybrew/postgresjs@4.5.0 lets queries with values take one round trip instead of two, and fixes wrong rows after a failed query, hangs after COPY TO and a crash when cancelling a query you don't await. No breaking changes; two behavior changes correct settings that did the opposite of what they say.
npm install @steadybrew/postgresjs@4.5.0- Queries with values can take one round trip instead of two, with
parameter_types: 'client'. In production on one app behind the Supabase pooler, the median query went from 5.3 to 3.1 ms. parameter_types: 'warn'reports the queries'client'would send differently.- Node.js 22 is supported.
await using sql = postgres()ends the pool, andusing reserved = await sql.reserve()releases the connection, when they go out of scope.PGPREPARE=false,PGFETCH_TYPES=false,PGDEBUG=falseandPGSSL=disable(orfalse) now turn those options off.target_session_attrs: 'read-write'no longer connects to a hot standby, and'read-only'now accepts one.- A query no longer gets empty slots at the start of its result after the previous query on the connection failed or was cancelled partway through its rows.
- Queries no longer hang after a
COPY ... TO STDOUTwhose reader fell behind. - Cancelling a query you don't await no longer crashes the process.
- dd-trace records Postgres.js spans again when the fork is installed as
postgres. - Code that assigns
err.stackon a query error no longer throws on Node 22 and newer. - TypeScript accepts the
sslnegotiationandsocketoptions. new PostgresError('message')sets the message, likeError.- Column names ending with an underscore no longer throw under the
camelandpascaltransforms. - A cancelled query no longer stays pending forever when a schema change made the server reject it before it started.
See the changelog for details and upstream references.
Validation: CI passed on Node 22/24/26 × PostgreSQL 15–18, Deno and workerd (run). Every upstream report and pull request listed as fixed has a test that fails on Postgres.js 3.4.9 for the reported reason and passes here.