Registry / database / chaos-database-sqlite

chaos-database-sqlite

JSON →
library15.0.0jsnpmunverified

SQLite adapter for Chaos ORM, a lightweight object-relational mapping library for Node.js. Version 15.0.0 is current, with releases on an as-needed basis. Key differentiator: provides a unified interface for SQLite databases within Chaos ORM ecosystem. Requires babel-polyfill as peer dependency for older Node.js compatibility. Not recommended for new projects; consider using better-sqlite3 or knex directly.

npm install chaos-database-sqlite
INSTALL
IMPORT
SIG · CHAOS-DATABASE-SQL
C
chaos-database-sqlite
databasejavascriptv15.0.0
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.

default
import Database from 'chaos-database-sqlite'
const Database = require('chaos-database-sqlite')
ESM-only; CommonJS require may fail depending on Node version
ChaosORM.SQLite
import { SQLite } from 'chaos-database-sqlite'
const { SQLite } = require('chaos-database-sqlite')
Named export for SQLite class; CommonJS require is not supported
type definitions
import type { SQLite } from 'chaos-database-sqlite'
TypeScript types are not bundled; may need @types/chaos-database-sqlite if available

Shows how to connect, create table, insert a record, and close connection using Chaos ORM SQLite adapter.

import Database from 'chaos-database-sqlite'; import babelPolyfill from 'babel-polyfill'; // ensure polyfill is imported const db = new Database({ database: 'test.db' }); db.connect().then(() => { return db.execute("CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)"); }).then(() => { return db.insert('users', { name: 'John' }); }).then(result => { console.log('Inserted ID:', result); return db.close(); }).catch(err => console.error(err));
Debug
Known issues
deprecatedPackage is in maintenance mode. No active development.
fix
Consider migrating to better-sqlite3 or knex with sqlite3.
affects: >=15.0.0
gotchaRequires babel-polyfill as peer dependency for async/await support in older Node environments.
fix
Install babel-polyfill: npm install babel-polyfill
affects: >=1.0.0
gotchaESM-only; CommonJS require may not work.
fix
Use import syntax and ensure Node version supports ESM (>=12).
affects: >=15.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-polyfill'
Missing peer dependency babel-polyfill.
fix
npm install babel-polyfill
TypeError: Database is not a constructor
Using CommonJS require instead of ESM import.
fix
Use import Database from 'chaos-database-sqlite'
Upgrade
Version history
15.0.0latest on npm
Audit
Dependencies
babel-polyfilloptionalrequired as peer dependency for ES6+ features in older environments
Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
chaos-database-sqlite — npm install chaos-database-sqlite · libregistry