@sqb/postgres
v6.0.12
Published
SQB serialization extension for PostgreSQL database
Readme
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 >= 20.x
License
SQB is available under MIT license.
