Changelog - 2026-07-11
Postgres Driver Seam & Supabase
Breaking Change Security New Feature Bug FixIn one line. You can use either node-postgres or postgres-js with the Postgres connector, use the new Supabase submodule, and a failed commit() or rollback() now throws instead of looking like it worked.
What changed
- Two drivers. Both
node-postgres(pg) andpostgres-js(postgres) now implement oneIRelationalDrivercontract and can back a datasource. - Transactions fail loudly.
commit()androllback()throw when the database operation fails. Before, a failedCOMMITresolved, so the transaction looked committed but nothing was written. IGNIS destroys the connection behind a failed commit or rollback instead of returning it to the pool. A failedBEGINno longer leaks its connection. pgandpostgresare optional peers. An app that uses one never needs to install the other.- New sub-paths.
@venizia/ignis/postgres/node-postgres,@venizia/ignis/postgres/postgres-jsand@venizia/ignis/postgres/supabase. - Supabase submodule. Supavisor pooler presets (
PoolerModes,buildPostgresJsOptions) and a transaction-scoped RLS helper,withAuthContext({ transaction, claims, role? }). It setsrequest.jwt.claimsandSET LOCAL ROLE, soauth.uid()works in RLS policies under a transaction pooler.roledefaults to the JWT'sroleclaim. - Security fix. The RLS role is now validated against a strict identifier pattern before use. This closes a SQL-injection path through a JWT-supplied role claim.
- Fixed. The
@venizia/ignis/grpcexport pointed at a missing directory and threwERR_MODULE_NOT_FOUND.
Who is affected
- Apps that call
commit()orrollback()directly, or importTNodePostgresTransactionConnector. See breaking changes. - Supabase users. The submodule is opt-in.
- Apps that install only one of
pgorpostgres. No action needed.
Breaking changes
commit()androllback()throw on failure. Put the rollback in its owntryso a rollback failure never hides the original error.typescript// Before try { await userRepository.create({ data: user, options: { transaction } }); await transaction.commit(); // a failed COMMIT resolved silently } catch (error) { await transaction.rollback(); // could throw and mask `error` throw error; } // After try { await userRepository.create({ data: user, options: { transaction } }); await transaction.commit(); // throws if COMMIT fails } catch (error) { try { await transaction.rollback(); } catch (rollbackError) { // log and continue } throw error; }IDatabaseTransaction.connectoris retyped toTRelationalConnector<Schema>.TNodePostgresTransactionConnectorandTNodePostgresConnectorremain as@deprecatedaliases, so existing code still compiles.typescript// Before import type { TNodePostgresTransactionConnector } from '@venizia/ignis/postgres'; // After import type { TRelationalConnector } from '@venizia/ignis/postgres';Build tooling that prunes optional peers. Install the driver you use:
bashbun add pg # node-postgres bun add postgres # postgres-js (needed for the Supabase transaction pooler)
Details
useDriver({ driver, schema? })sets a datasource's driver and rebuilds its connector in one call.resolveDatabaseDriver({ client })detects the client (postgres-js or node-postgres) and loads only the matching driver.buildPostgresJsOptions({ mode: PoolerModes.TRANSACTION })returns{ prepare: false }, which Supavisor's transaction pool mode requires.- After a failed
COMMIT,node-postgresdiscards the poisoned connection.postgres-jscannot, so it returns the connection to its pool.