SQB is an extensible, multi-dialect SQL query builder and Database connection wrapper for NodeJS.
This package is a SQB Adapter for SQLite backed by sql.js,
a WebAssembly build of SQLite. Unlike @sqb/sqlite, it needs no native bindings or a
runtime-provided SQLite module, so it runs anywhere WebAssembly does — including the browser.
Pass a file path as database to load (and keep in sync with) an on-disk .sqlite file, or
:memory: (optionally suffixed, e.g. :memory:test1) for a purely in-memory database. Databases
opened with the same name are reference-counted and shared across connections rather than reopened.
It shares its SQL serialization rules with @sqb/sqlite via @sqb/sqlite-dialect.
$ npm install @sqb/sqljs --saveimport '@sqb/sqljs';
import { SqbClient } from '@sqb/connect';
const client = new SqbClient({
driver: 'sqljs',
database: '/path/to/database.sqlite', // or ':memory:'
});- node >= 20.x
SQB is available under MIT license.
