Registry / database / streamsql

streamsql

JSON →
library0.8.5jsnpmunverified

A streaming, backend-agnostic SQL ORM for Node.js, inspired by levelup. Version 0.8.5 is the latest stable release, with sparse maintenance. It supports MySQL and SQLite3 drivers, providing a stream-based API for CRUD operations on database tables. Key differentiators include a streaming interface (createReadStream, createWriteStream) and backend abstraction, but note it does not auto-install database drivers. Current status is 'deprecated' as it was last published in 2013 and has no recent updates.

npm install streamsql
INSTALL
IMPORT
SIG · STREAMSQL
S
streamsql
databasejavascriptv0.8.5
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.

streamsql
const streamsql = require('streamsql');
import streamsql from 'streamsql';
This package is CommonJS only, no ESM support.
db
const db = streamsql.connect({ driver: 'sqlite3', filename: ':memory:' });
const db = new streamsql();
Use connect() to get a db instance; new streamsql() is not a constructor.
table
db.table('users', { fields: ['id', 'name'] });
db.registerTable('users', { fields: ['id', 'name'] });
The method is table() not registerTable().

Shows how to initialize streamsql with sqlite3, register a table, insert a row, and fetch it.

const streamsql = require('streamsql'); const db = streamsql.connect({ driver: 'sqlite3', filename: ':memory:' }); db.table('users', { fields: ['id', 'name', 'email'], primaryKey: 'id' }); const users = db.table('users'); users.put({ id: 1, name: 'Alice', email: 'alice@example.com' }, (err) => { if (err) throw err; users.get(1, (err, row) => { if (err) throw err; console.log(row); }); });
Debug
Known issues
deprecatedPackage is deprecated with no updates since 2013.
fix
Consider using a maintained ORM like sequelize, knex, or objection.
affects: >=0.0.0
breakingDatabase drivers must be installed separately; they are not included as dependencies.
fix
Run npm install mysql or npm install sqlite3 in addition to streamsql.
affects: >=0.0.0
gotchaThe connect() method does not accept a callback; it returns the db object synchronously.
fix
Use the returned db object directly; no need to wait for a connection event.
affects: >=0.0.0
gotchatable() does not create the actual table in the database; it only registers a definition.
fix
You must manually run CREATE TABLE SQL using db.query() or an external tool.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'mysql'
MySQL driver not installed.
fix
Run: npm install mysql
Cannot find module 'sqlite3'
SQLite3 driver not installed.
fix
Run: npm install sqlite3
TypeError: db.table is not a function
Using db.registerTable instead of db.table, or db is not initialized correctly.
fix
Use db.table('name', definition) after calling streamsql.connect().
Upgrade
Version history
0.8.5latest on npm
Audit
Dependencies
mysqloptionalRequired for MySQL driver support, not included as a direct dependency.
sqlite3optionalRequired for SQLite3 driver support, not included as a direct dependency.
Agent activity
15 hits · last 30 days
node
12
Meta
2
OpenAI (training)
1
Resources
streamsql — npm install streamsql · libregistry