Registry / database / sqlite-sync

sqlite-sync

JSON →
library0.3.9jsnpmunverified

A lightweight Node.js module for SQLite database operations supporting both synchronous and asynchronous execution. Current stable version is 0.3.9 (last updated 2016). It provides simple wrappers for connect, run, insert, update, and close operations, with a callback-based async API and synchronous variants. Key differentiator is the mixed sync/async support, but it is outdated and lacks modern features like promises, ESM, or TypeScript definitions. Not recommended for new projects.

database
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

No ESM or named export; must use CommonJS require. No default export for ES modules.

const sqlite = require('sqlite-sync');

connect does not return a connection object; it modifies the module's internal state.

sqlite.connect('path/to/db');

run can be used synchronously without callback, but async usage requires callback.

sqlite.run('SQL', callback);

Basic setup: connecting to a database, creating a table, inserting a row (async), and querying all rows (sync).

const sqlite = require('sqlite-sync'); sqlite.connect('test.db'); sqlite.run("CREATE TABLE IF NOT EXISTS items (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)", res => { if (res.error) throw res.error; console.log('Table created'); }); sqlite.insert("items", {name: "example"}, res => { if (res.error) throw res.error; console.log('Inserted with ID:', res.insertId); }); const rows = sqlite.run("SELECT * FROM items"); console.log(rows); sqlite.close();
Debug
Known footguns
deprecatedPackage is no longer actively maintained; last update in 2016.
gotchaCallbacks have inconsistent signatures: some return {error, ...}, others return raw rows.
gotchaThe module modifies internal state on connect; you can only have one connection at a time.
gotchaSynchronous operations block the event loop, which can cause performance issues or crashes for large queries.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
13 hits · last 30 days
gptbot
3
amazonbot
3
bingbot
1
mj12bot
1
Resources