Registry / database / node-bits-sql

node-bits-sql

JSON →
library0.0.66jsnpmunverified

A thin wrapper around Sequelize v3 that implements the node-bits database contract for SQL databases (PostgreSQL, MySQL, SQLite, MSSQL). Version 0.0.66 (latest, no recent updates) provides schema-based model definition, migration management, seed data injection, and hooks for lifecycle events. Unlike raw Sequelize, it integrates with the node-bits ecosystem of modular bits, but it is not actively maintained and lacks TypeScript definitions.

npm install node-bits-sql
INSTALL
IMPORT
SIG · NODE-BITS-SQL
N
node-bits-sql
databasejavascriptv0.0.66
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.

nodeBitsSql
import nodeBitsSql from 'node-bits-sql'
const { nodeBitsSql } = require('node-bits-sql')
Package does not support named export — default export only.
nodeBitsSql
const nodeBitsSql = require('node-bits-sql')
import { nodeBitsSql } from 'node-bits-sql'
CommonJS default export — wrapped in module.exports.
sequelize
This package does not export 'sequelize'; it expects Sequelize instance from 'sequelize' package.
import { sequelize } from 'node-bits-sql'
Users often mistakenly expect Sequelize to be re-exported. You must install and create your own Sequelize instance.

Shows common initialization: create Sequelize instance, pass to nodeBitsSql configuration with migrations and seeds enabled, attach a hook.

const Sequelize = require('sequelize'); const nodeBitsSql = require('node-bits-sql'); const sequelize = new Sequelize(process.env.DATABASE_URL ?? 'postgres://user:pass@localhost:5432/mydb', { dialect: 'postgres' }); const sqlBit = nodeBitsSql({ connection: () => sequelize, runSeeds: true, runMigrations: true, hooks: [ (args) => { if (args.stage === 'BEFORE') { console.log(`Executing ${args.action} on ${args.name}`); } } ] }); module.exports = sqlBit;
Debug
Known issues
breakingThe Sequelize v3 dependency is outdated and incompatible with Sequelize v4/v5/v6+.
fix
Use Sequelize v3 (sequelize@^3.0.0) or consider migrating to a modern alternative.
affects: >=0.0.1
deprecatedThe package is no longer maintained; last release was in 2019.
fix
Seek alternatives like direct Sequelize use or other ORM wrappers.
affects: >=0.0.1
gotcharunSeeds expects seeds in the latest schema format; misaligned seeds cause silent failures.
fix
Ensure seed files match the current schema structure exactly.
affects: >=0.0.1
gotchaforceSync and runMigrations are mutually exclusive; forceSync takes precedence if both are true.
fix
Set only one of these to true; never use forceSync in production.
affects: >=0.0.1
breakingConnection property expects a function that returns a Sequelize instance, not a direct instance in older versions.
fix
Wrap your Sequelize instance in a function: connection: () => sequelize
affects: <0.0.55
Errors
Common errors & fixes
Cannot find module 'sequelize'
Missing peer dependency sequelize
fix
npm install sequelize@^3.0.0
TypeError: nodeBitsSql is not a function
Incorrect import (e.g., using named import instead of default import)
fix
Use: const nodeBitsSql = require('node-bits-sql');
Connection property must be a function
Passed Sequelize instance directly instead of a function
fix
Wrap in function: connection: () => sequelize
forceSync and runMigrations cannot both be true
Mutually exclusive options set simultaneously
fix
Set only one to true, preferably runMigrations in production
Upgrade
Version history
0.0.66latest on npm
Audit
Dependencies
sequelizerequiredRuntime dependency — node-bits-sql wraps Sequelize ORM; version compatibility may break
pgoptionalRequired for PostgreSQL connections if using pg dialect
pg-hstoreoptionalRequired for PostgreSQL hstore support
Agent activity
4 hits · last 30 days
node
4
Resources
node-bits-sql — npm install node-bits-sql · libregistry