Registry / database / dbshift

dbshift

JSON →
library1.0.2jsnpmunverified

DBShift v1.0.2 is a production-ready MySQL database migration tool inspired by Flyway, built for Node.js (>=14). It offers a dual-mode architecture with an interactive terminal UI (React + Ink) and a traditional CLI, enabling author-based sequencing to prevent team conflicts, session persistence, rich history tracking, multi-environment config, and connection testing.

npm install dbshift
INSTALL
IMPORT
SIG · DBSHIFT
D
dbshift
databasejavascriptv1.0.2
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.

dbshift
✓ import dbshift from 'dbshift'
✗ const dbshift = require('dbshift')
ESM-only; require() will fail.
init
✓ import { init } from 'dbshift'
✗ const init = require('dbshift').init
Named export for programmatic initialization.
migrate
✓ import { migrate } from 'dbshift'
✗ const migrate = require('dbshift/migrate')
Export from main entry; subpath imports not supported.

Demonstrates programmatic usage with imports for initialization and migration.

import dbshift from 'dbshift'; import { init, migrate } from 'dbshift'; // Initialize project init(); // Run migrations migrate(process.env.DB_URL ?? 'mysql://user:pass@localhost:3306/mydb'); // Or use CLI (interactive mode) // $ dbshift
Debug
Known issues
gotchaGlobal install required for CLI `dbshift` command; local install does not expose binary.
fix
Install globally: npm install -g dbshift
affects: >=1.0.0
breakingESM-only package; CommonJS require() throws error.
fix
Use import syntax or upgrade Node to >=14 with type: module in package.json
affects: >=1.0.0
gotchaInteractive mode requires Node.js >=14; older versions not supported.
fix
Upgrade Node to >=14 or use CLI mode with --cli flag
affects: >=1.0.0
deprecatedVersion 0.x used legacy CLI; v1.0+ introduces dual-mode and breaks backward compatibility.
fix
Upgrade to v1.0.2 and follow new interactive/CLI syntax
affects: <1.0.0
Errors
Common errors & fixes
dbshift: command not found
Package not installed globally.
fix
Run `npm install -g dbshift`
ERR_REQUIRE_ESM: require() of ES Module not supported
Using require() instead of import.
fix
Use `import dbshift from 'dbshift'` or set `type: module` in package.json
Error: Cannot find module 'react'
Interactive mode dependencies not installed.
fix
Run `npm install` in project root or install dbshift with --include=dev
Error: connect ECONNREFUSED 127.0.0.1:3306
MySQL server not running or wrong connection config.
fix
Ensure MySQL is running and DB_URL env variable is set correctly
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
mysql2requiredMySQL database connectivity
reactrequiredInteractive UI rendering via Ink
inkrequiredReact-based terminal UI framework
Agent activity
8 hits · last 30 days
node
6
Amazon
1
Resources
dbshift — npm install dbshift · libregistry