@sqb/postgres
v6.8.0
Published
SQB adapter for the postgrejs driver
Readme
@sqb/postgres
SQB adapter for the postgrejs driver.
About SQB
SQB is an extensible, multi-dialect SQL query builder and Database connection wrapper for NodeJS.
About @sqb/postgres
This package is a SQB Adapter for PostgreSQL, backed by postgrejs,
a pure-JS driver with no native bindings. It supports cursors, working schemas, and fetching
date/timestamp columns as raw strings instead of Date objects (fetchAsString).
Since Postgres supports RETURNING natively on INSERT, UPDATE and DELETE,
INSERT ... RETURNING / UPDATE ... RETURNING need no follow-up SELECT — affected rows are
read directly from the statement response, the same as every other query.
Installation
$ npm install @sqb/postgres --saveUsage
import '@sqb/postgres';
import { SqbClient } from '@sqb/connect';
const client = new SqbClient({
driver: 'postgrejs',
host: 'localhost',
port: 5432,
user: 'postgres',
database: 'mydb',
});Node Compatibility
- Node.js 22 or later.
License
SQB is available under the BSD 3-Clause license.
