Skip to content

photostructure/node-sqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@photostructure/sqlite

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.

Installation

npm install @photostructure/sqlite

Quick Start

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();

Features

  • 100% compatible with Node.js v25 built-in node:sqlite module*
  • Zero dependencies - native SQLite implementation
  • Synchronous API - no async overhead
  • Performance matches leading SQLite libraries
  • Full SQLite feature set (details)
  • TypeScript support with complete type definitions
  • Cross-platform prebuilt binaries (Windows/macOS/Linux, x64/ARM64)
  • User-defined functions and aggregates
  • Database backups and session/changeset support
  • Session class exposed for advanced replication workflows
  • Native Symbol.dispose for improved resource management
  • URI filename support for advanced configuration
  • Worker thread safe
  • Compare with other libraries →

Note

*API-compatible with Node.js SQLite, but this library adopts SQLite-recommended features and security-enhancing build flags. See build configuration details.

  • DataView parameter binding is not currently supported. Use Buffer instead for binary data.

Documentation

Getting Started

Using SQLite

Reference

Support

License

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.

About

Drop-in replacement for `node:sqlite`

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •