@sqb/sqlite
v6.8.0
Published
SQB adapter for Node.js and Bun's native SQLite drivers
Readme
@sqb/sqlite
SQB adapter for Node.js and Bun's native SQLite drivers.
About SQB
SQB is an extensible, multi-dialect SQL query builder and Database connection wrapper for NodeJS.
About @sqb/sqlite
This package is a SQB Adapter for SQLite that uses the runtime's own native SQLite
bindings instead of a WASM build:
node:sqlitewhen running under Node.js (>= 22.5)bun:sqlitewhen running under Bun
The correct driver is picked automatically at runtime — no configuration needed. Neither needs a native build step, since the runtime ships SQLite itself.
@sqb/sqljs, the sql.js WASM adapter, is deprecated and will be removed in
SQB 7.0.0; this package replaces it. The two share the same
@sqb/sqlite-dialect SQL serialization rules, so queries behave
identically, but only sql.js runs in a browser — see
MIGRATION-sqljs-to-sqlite.md.
Installation
$ npm install @sqb/sqlite --saveUsage
import '@sqb/sqlite';
import { SqbClient } from '@sqb/connect';
const client = new SqbClient({
driver: 'sqlite',
database: '/path/to/database.db', // or ':memory:' (optionally suffixed, e.g. ':memory:test1')
});Node Compatibility
- node >= 22.5 (for
node:sqlite), or any recent Bun version (forbun:sqlite)
License
SQB is available under the BSD 3-Clause license.
