A thin promise-based wrapper around the pg (node-postgres) library that provides a connection pool and transaction management with commit/rollback support. Current version 1.0.4 targets Node 4.3.1+ and npm 3.7.3+. It uses raw promises (no async/await) and is designed for simple PostgreSQL interaction in legacy Node.js environments. Compared to alternatives like pg-promise or sequelize, it offers minimal abstraction, no query building, and no connection monitoring. The package is in maintenance mode with no recent updates and is suitable only for projects locked to older Node versions.
npm install q-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creating a pool, getting a connection, opening a transaction, running a query, committing, and releasing the connection.
Use a newer library like pg-promise or knex for modern Node environments.
Consider migrating to a promise-based library that supports async/await (e.g., pg-promise).
Always provide all five arguments: user, password, host, database, and optional URL.
Attach .catch(transaction.rollback) to the promise chain as shown in the README.
Run 'npm install q-postgres' and ensure it's in node_modules.
Use 'const qPostgres = require('q-postgres');' without destructuring.Ensure PostgreSQL server is running and accessible; use an IP address or proper hostname.