An NPM wrapper for the Go-based sql-migrate database migration tool. Version 1.8.1 provides OS-agnostic native binaries for Windows, macOS, and Linux without requiring Go installation. The package uses optional dependencies to download only the relevant binary for the target platform, keeping node_modules small. It supports all sql-migrate commands (up, down, status, new) via npx or global install. Key differentiators: zero Go dependencies, CI/CD friendly with tiny footprint, and automatic architecture detection. Updates follow sql-migrate releases, currently wrapping v1.6.0.
npm install npmw-sql-migrateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure and run database migrations using npx without installing the package globally.
Verify your OS and architecture are listed in the supported platforms. Use npm install --ignore-optional to skip binary download if you plan to use a different method.
Place a dbconfig.yml in the root directory of your project.
To use a different version of sql-migrate, install the Go tool directly.
Consider using the official sql-migrate binary directly if you need the latest features.
Use a Windows x64 system or run the Go tool directly.
Run 'npm install --save-dev npmw-sql-migrate' in your project root.
Create a dbconfig.yml in the directory where you run the command.
Use 'npx sql-migrate' from the command line instead of importing.