Registry / database / deepbase-sqlite

deepbase-sqlite

JSON →
library3.6.9jsnpmunverified

SQLite database driver for DeepBase providing high-performance, ACID-compliant storage for nested JavaScript objects. Uses better-sqlite3 with synchronous operations wrapped in async API. Supports PRAGMA modes (none, safe, balanced, fast) for tuning durability vs performance. Includes singleton pattern for shared connections across instances. Current stable version: 3.6.9. Active development with regular releases. Key differentiator: seamlessly integrates with DeepBase's nested object storage using dot-notation path indexing and monotonic sequence ordering for deterministic key order.

npm install deepbase-sqlite
INSTALL
IMPORT
SIG · DEEPBASE-SQLITE
D
deepbase-sqlite
databasejavascriptv3.6.9
harness data pending
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.

SqliteDriver
import SqliteDriver from 'deepbase-sqlite'
import { SqliteDriver } from 'deepbase-sqlite'
Default export only. Named import will fail. TypeScript types are included.
DeepBase
import DeepBase from 'deepbase'
import { DeepBase } from 'deepbase'
DeepBase is also a default export from its own package.
SqliteFastDriver
import SqliteFastDriver from 'deepbase-sqlite'
import { SqliteFastDriver } from 'deepbase-sqlite'
Legacy name for SqliteDriver with pragma:'fast'. Kept for backward compatibility. Same default export pattern.

Creates a DeepBase instance with SQLite driver, connects, sets and retrieves a nested object, then closes.

import DeepBase from 'deepbase'; import SqliteDriver from 'deepbase-sqlite'; const db = new DeepBase(new SqliteDriver({ path: './data', name: 'quickstart', pragma: 'balanced' })); await db.connect(); await db.set('users', 'alice', { name: 'Alice', age: 30 }); const alice = await db.get('users', 'alice'); console.log(alice); // { name: 'Alice', age: 30 } await db.close();
Debug
Known issues
breakingPragma mode 'none' uses WITHOUT ROWID tables by default in v3.0+ causing schema mismatch with databases created by v2.x.
fix
Use explicit pragma: 'none' to create backward-compatible tables.
affects: >=3.0.0 <3.3.0
deprecatedSqliteFastDriver is deprecated. Use SqliteDriver with {pragma: 'fast'} instead.
fix
Replace SqliteFastDriver with new SqliteDriver({ pragma: 'fast' }).
affects: >=3.0.0
gotchaNative module better-sqlite3 requires build tools (Python, C++ compiler) if prebuilt binaries are unavailable.
fix
Install with --ignore-scripts=false or manually install better-sqlite3 after checking build prerequisites.
affects: *
gotchaSingleton connection sharing can lead to unexpected state if one instance is closed while others are still in use.
fix
Manage a single instance per database file or use separate paths to avoid sharing.
affects: *
gotchaThe 'seq' column was added in v3.3+ for deterministic ordering. Legacy databases without this column will order by key alphabetically.
fix
Run ALTER TABLE to add seq column (driver does this automatically on connect for v3.3+).
affects: <3.3.0
Errors
Common errors & fixes
Error: The module 'better-sqlite3' was not found. Make sure you have installed it.
Missing better-sqlite3 dependency (native module not installed or build failed).
fix
Run 'npm install deepbase-sqlite --ignore-scripts=false' or install better-sqlite3 manually.
TypeError: SqliteDriver is not a constructor
Using named import { SqliteDriver } instead of default import.
fix
Change to: import SqliteDriver from 'deepbase-sqlite'
sqlite3 error: table already exists
Two DeepBase instances with same name on same path but different pragma modes causing schema conflict.
fix
Use identical pragma mode or different database names.
Error: Cannot find module 'deepbase'
Missing peer dependency deepbase.
fix
Run 'npm install deepbase' alongside deepbase-sqlite.
Upgrade
Version history
3.6.9latest on npm
Audit
Dependencies
deepbaserequiredpeer dependency - driver is used with DeepBase instance
better-sqlite3requiredunderlying SQLite library (native module)
Agent activity
4 hits · last 30 days
node
4
Resources
deepbase-sqlite — npm install deepbase-sqlite · libregistry