A compatibility layer that wraps the faster, leaner 'postgres' library (the porsager/postgres) with the widely-adopted 'pg' API (node-postgres). Currently at version 1.14.0, the project is stable and actively maintained with regular releases. Key differentiator: enables adopting the performance benefits of 'postgres' without migrating from 'pg' — especially useful for existing projects using Slonik or other pg-dependent libraries. Known limitations include no implicit pooling, no callback interface, no environment variable config, and no processID support.
npm install postgres-bridgeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a PostgreSQL pool using postgres-bridge, connecting to a local PG instance and running a parameterized query.
Replace pool.query() with pool.connect() then connection.query() and release.
Use async/await or .then() instead of callbacks.
Read environment variables manually and pass them to the constructor.
Do not rely on processID; handle undefined gracefully.
Avoid accessing private pool properties.
import { createPostgresBridge } from 'postgres-bridge'const PostgresBridge = createPostgresBridge(postgres);
const client = await pool.connect(); const result = await client.query(...); client.release();