Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

SQB Logo


NPM Version NPM Downloads CI Tests Test Coverage

About SQB

SQB is an extensible, multi-dialect SQL query builder and Database connection wrapper for NodeJS.

About @sqb/sqljs

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.

Installation

$ npm install @sqb/sqljs --save

Usage

import '@sqb/sqljs';
import { SqbClient } from '@sqb/connect';

const client = new SqbClient({
  driver: 'sqljs',
  database: '/path/to/database.sqlite', // or ':memory:'
});

Node Compatibility

  • node >= 20.x

License

SQB is available under MIT license.