A minimal SQL generator for Node.js and PostgreSQL that builds parameterized queries with support for SELECT, INSERT, UPDATE, DELETE, WHERE, ORDER BY, LIMIT/OFFSET, and RETURNING clauses. Version 0.0.6 is the current release; the library has a low release cadence and is not actively developed. It generates query objects with 'text' and 'values' properties compatible with the 'pg' module. Compared to alternatives like Squel or Knex, psqljs is extremely minimal with no dependencies but lacks TypeScript support, join building, raw SQL escape hatches, and advanced features.
npm install psqljsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage of psqljs to generate SELECT, INSERT, UPDATE, and DELETE parameterized queries.
Define your own types or use @ts-ignore when importing.
Use another library like Knex or Squel if you need JOINs.
Consider migrating to a maintained alternative like Knex.js or pg-promise.
Ensure you call .toQuery() at the end of the chain.
Use const sql = require('psqljs'); then sql.select().Add .toQuery() at the end: sql.select().from('users').toQuery()Run npm install psqljs --save and ensure package.json includes it.
No dependency data recorded yet.