A zero-dependency, type-safe Postgres client for Node.js (v0.0.6). It includes a from-scratch implementation of the Postgres protocol with connection pooling, query cancellation, and SQL injection prevention via prepared statements. Its standout feature is a webpack loader that type-checks static SQL queries at compile time using TypeScript template literal types, catching errors before runtime. Designed for strict one-to-one mapping between Postgres and JavaScript types. Released as an experimental alpha with monthly updates.
npm install pgeonNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows connecting to a Postgres database using a connection pool and executing a static query with type safety via the sql template literal tag.
Always import sql from pgeon and use it directly without renaming.
Order loaders as: ['ts-loader', 'pgeon/webpack-loader.ts'] in the use array.
Pin to exact version and expect API changes.
Use sql tag for all queries that have static structure, and manually type dynamic queries.
Use ESM imports (import) and set type: 'module' in package.json.
Run npm install pgeon
Ensure db = newPool() and that newPool is imported correctly.
Add ts-loader and ensure rules array includes ts-loader before pgeon's webpack-loader.