pg-gateway is a TypeScript library that implements the PostgreSQL wire protocol for the server side, enabling developers to build custom Postgres-compatible proxies, middleware, or gateways. The current version is 0.3.0-beta.4, indicating an early beta stage with potential breaking changes. It focuses on low-level protocol handling, differentiating from higher-level clients like node-postgres by giving direct control over the protocol flow. Releases are infrequent and experimental.
npm install pg-gatewayVerified import paths — ran on the pinned version, not inferred.
Creates a simple TCP server that uses pg-gateway to proxy client connections to a real PostgreSQL instance, demonstrating the primary use case.
Pin to a specific version and test upgrades carefully. Consult changelog if available.
Do not import in client-side code; ensure bundler excludes it for browser bundles.
Watch for updates and migration guides.
Use `import PgGateway from 'pg-gateway'` in ESM, or `const PgGateway = require('pg-gateway').default` in CommonJS.Install with `npm install pg-gateway` and verify the import path is correct.
Use only in Node.js; exclude from browser bundles.