{"library":"pg-gateway","title":"pg-gateway","description":"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.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install pg-gateway"],"cli":null},"imports":["import PgGateway from 'pg-gateway'","import { PgGateway } from 'pg-gateway'","import { BackendMessage } from 'pg-gateway'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import PgGateway from 'pg-gateway';\nimport net from 'node:net';\n\nconst gateway = new PgGateway();\n// Create a server that proxies to a real PostgreSQL backend\nnet.createServer((socket) => {\n  gateway.handleClient(socket, {\n    backend: { host: 'localhost', port: 5432, user: 'user', password: process.env.PGPASSWORD ?? '' }\n  });\n}).listen(5433, () => {\n  console.log('Gateway listening on 5433');\n});","lang":"typescript","description":"Creates a simple TCP server that uses pg-gateway to proxy client connections to a real PostgreSQL instance, demonstrating the primary use case.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}