A lightweight, zero-dependency SQLite wrapper for Node.js that communicates with the sqlite3 CLI via stdin/stdout — no native addons, no node-gyp, no ABI headaches. Version 4.0.6 requires Node.js >= 18 and the sqlite3 CLI executable on the system. Key differentiators: pure JavaScript, no compilation needed; long-lived single sqlite3 process for the entire app lifecycle; Promise-based API with execute(), query(), and stream() methods; automatic transaction support with concurrent caller serialization; dedicated reader pool for concurrent read queries; per-statement timeout with process-level failure recovery; auto-restart on crash; runtime metrics (QPS, avg query time, timeout count, restarts). Includes full TypeScript types and dual ESM/CommonJS module support.
npm install sqlite-executorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an in-memory SQLite database, creates a table, inserts two rows, queries them, and closes the connection.
Upgrade Node.js to v18 or later, or stick with v3.x if you need older Node support.
Replace callbacks with async/await or .then(). The constructor and method signatures changed.
Use named import: import { SQLiteExecutor } from 'sqlite-executor' instead of import SQLiteExecutor from 'sqlite-executor'.Install sqlite3 (e.g., apt install sqlite3, brew install sqlite3, choco install sqlite). The npm package 'sqlite3' is not required.
Specify a database file path when using poolSize > 0, or set poolSize to 0 for in-memory databases.
Keep transactions short. For heavy batch operations, consider using execute() without explicit transactions.
Use the Promise-based methods: query() for SELECT, execute() for INSERT/UPDATE/DELETE.
Run 'npm install sqlite-executor' in your project root.
Install sqlite3 via system package manager (apt, brew, choco) or specify custom binary path via 'binary' option.
Upgrade to v3.0.0 or later, or use db.all() (callback) in v2.x.
Ensure db.execute('CREATE TABLE...') runs before querying, and that the database file is not read-only or missing.No dependency data recorded yet.