SQLite compiled to JavaScript via Emscripten, enabling full SQL database operations in browsers and Node.js. Version 1.12.6 uses WebAssembly by default (falls back to asm.js), with a release cadence of several updates per year. Unlike native bindings (e.g., sqlite3), it does not require compilation and works purely in-memory, supporting import/export of SQLite database files as Uint8Array. Key differentiators: browser-native execution, no native dependencies, support for prepared statements, user-defined functions, and extension loading. Active development with ongoing maintenance.
npm install fts5sqljsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create an in-memory SQLite database, run DDL and DML, and query results using prepared statements.
Use db.export() to get a Uint8Array and save it manually (e.g., to localStorage or a file).
Call stmt.free() after finished or use db.run() for one-off queries.
Use await initSqlJs() or .then() pattern.
Run npm install sql.js and use import initSqlJs from 'sql.js'.
Ensure you await initSqlJs() before accessing SQL.Database.
Set locateFile: file => '/path/to/sql-wasm.wasm' or host the .wasm file.
No dependency data recorded yet.