Native SQLite for Node.js 20+ without the experimental flag. Drop-in replacement for node:sqlite. Updated to Node.js v25 for latest features and native Symbol.dispose resource management.
npm install @photostructure/sqlite
import { DatabaseSync } from "@photostructure/sqlite";
const db = new DatabaseSync(":memory:");
db.exec("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)");
const insert = db.prepare("INSERT INTO users (name) VALUES (?)");
insert.run("Alice");
const users = db.prepare("SELECT * FROM users").all();
console.log(users); // [{ id: 1, name: 'Alice' }]
db.close();
node:sqlite module**API-compatible with Node.js SQLite, but this library adopts SQLite-recommended features and security-enhancing build flags. See build configuration details.
Getting Started
Using SQLite
Reference
MIT - see LICENSE for details.
This package includes SQLite (public domain) and code from Node.js (MIT licensed).
Note: This package is not affiliated with the Node.js project. It extracts and redistributes Node.js's SQLite implementation under the MIT license.