{"id":43425,"library":"node-bits-sql","title":"node-bits-sql","description":"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.","status":"abandoned","version":"0.0.66","language":"javascript","source_language":"en","source_url":"https://github.com/jgretz/node-bits-sql","tags":["javascript"],"install":[{"cmd":"npm install node-bits-sql","lang":"bash","label":"npm"},{"cmd":"yarn add node-bits-sql","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-bits-sql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency — node-bits-sql wraps Sequelize ORM; version compatibility may break","package":"sequelize","optional":false},{"reason":"Required for PostgreSQL connections if using pg dialect","package":"pg","optional":true},{"reason":"Required for PostgreSQL hstore support","package":"pg-hstore","optional":true}],"imports":[{"note":"Package does not support named export — default export only.","wrong":"const { nodeBitsSql } = require('node-bits-sql')","symbol":"nodeBitsSql","correct":"import nodeBitsSql from 'node-bits-sql'"},{"note":"CommonJS default export — wrapped in module.exports.","wrong":"import { nodeBitsSql } from 'node-bits-sql'","symbol":"nodeBitsSql","correct":"const nodeBitsSql = require('node-bits-sql')"},{"note":"Users often mistakenly expect Sequelize to be re-exported. You must install and create your own Sequelize instance.","wrong":"import { sequelize } from 'node-bits-sql'","symbol":"sequelize","correct":"This package does not export 'sequelize'; it expects Sequelize instance from 'sequelize' package."}],"quickstart":{"code":"const Sequelize = require('sequelize');\nconst nodeBitsSql = require('node-bits-sql');\n\nconst sequelize = new Sequelize(process.env.DATABASE_URL ?? 'postgres://user:pass@localhost:5432/mydb', { dialect: 'postgres' });\n\nconst sqlBit = nodeBitsSql({\n  connection: () => sequelize,\n  runSeeds: true,\n  runMigrations: true,\n  hooks: [\n    (args) => {\n      if (args.stage === 'BEFORE') {\n        console.log(`Executing ${args.action} on ${args.name}`);\n      }\n    }\n  ]\n});\n\nmodule.exports = sqlBit;","lang":"javascript","description":"Shows common initialization: create Sequelize instance, pass to nodeBitsSql configuration with migrations and seeds enabled, attach a hook."},"warnings":[{"fix":"Use Sequelize v3 (sequelize@^3.0.0) or consider migrating to a modern alternative.","message":"The Sequelize v3 dependency is outdated and incompatible with Sequelize v4/v5/v6+.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Seek alternatives like direct Sequelize use or other ORM wrappers.","message":"The package is no longer maintained; last release was in 2019.","severity":"deprecated","affected_versions":">=0.0.1"},{"fix":"Ensure seed files match the current schema structure exactly.","message":"runSeeds expects seeds in the latest schema format; misaligned seeds cause silent failures.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Set only one of these to true; never use forceSync in production.","message":"forceSync and runMigrations are mutually exclusive; forceSync takes precedence if both are true.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Wrap your Sequelize instance in a function: connection: () => sequelize","message":"Connection property expects a function that returns a Sequelize instance, not a direct instance in older versions.","severity":"breaking","affected_versions":"<0.0.55"}],"env_vars":null,"search_vec":"'0.0.66':27 'activ':66 'around':8 'base':35 'bit':3,16,57,61 'contract':18 'data':41 'databas':17,21 'definit':37,71 'ecosystem':58 'event':47 'hook':44 'implement':12 'inject':42 'integr':52 'javascript':72 'lack':69 'latest':28 'lifecycl':46 'maintain':67 'manag':39 'migrat':38 'model':36 'modular':60 'mssql':25 'mysql':23 'node':2,15,56 'node-bit':14,55 'node-bits-sql':1 'postgresql':22 'provid':32 'raw':49 'recent':30 'schema':34 'schema-bas':33 'seed':40 'sequel':9,50 'sql':4,20 'sqlite':24 'thin':6 'typescript':70 'unlik':48 'updat':31 'v3':10 'version':26 'wrapper':7","created_at":"2026-06-05T16:59:44.265991+00:00","updated_at":"2026-06-05T16:59:44.265991+00:00","problems":[{"fix":"npm install sequelize@^3.0.0","cause":"Missing peer dependency sequelize","error":"Cannot find module 'sequelize'"},{"fix":"Use: const nodeBitsSql = require('node-bits-sql');","cause":"Incorrect import (e.g., using named import instead of default import)","error":"TypeError: nodeBitsSql is not a function"},{"fix":"Wrap in function: connection: () => sequelize","cause":"Passed Sequelize instance directly instead of a function","error":"Connection property must be a function"},{"fix":"Set only one to true, preferably runMigrations in production","cause":"Mutually exclusive options set simultaneously","error":"forceSync and runMigrations cannot both be true"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/jgretz/node-bits-sql#readme","github":"https://github.com/jgretz/node-bits-sql","docs":null,"changelog":null,"pypi":null,"npm":"node-bits-sql","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}