A Node.js library (v3.0.0) that provides a consistent, simplified abstraction over PostgreSQL, MySQL, and SQLite3 databases. Released under MIT license on GitHub, with irregular release cadence. Key differentiators: unified ?-based bind variables across all backends, optional connection pooling with configurable limits and keep-alive, a batch SQL runner, and a transaction API that abstracts over connections. Smaller footprint than knex or sequelize but offers lower-level control.
npm install sql-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic query execution with PostgreSQLClient and connection pooling with PostgreSQLClientPool using environment variable for connection string.
Always use ? for bind parameters. For PostgreSQL, avoid $1, $2 unless you want literal text.
Ensure URI components are properly percent-encoded. Use Node's url.parse or new URL() to validate.
Update Node.js to version 12 or later.
Replace new Transaction(client) with manual execute('BEGIN'), execute('COMMIT') etc.Use try/finally or a callback that always returns the connection.
Check the documentation or console.log(resultset) to inspect structure.
Run npm install sql-client or ensure node_modules contains the package.
Start your database server or check the connection string in DATABASE_URL.
Ensure you created a pool: const pool = new sqlClient.PostgreSQLClientPool(url); pool.open(options, callback);
Ensure array length matches placeholder count: execute('SELECT ?, ?', [1, 2], ...).No dependency data recorded yet.