db-migrate vs sqlx-cli
db-migrate
github.comsqlx-cli
github.comSide by side
| Figure | db-migrate | sqlx-cli |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Windows | — | Yes |
| macOS | — | Yes |
| Linux | Yes | Yes |
| Self-hosted | Yes | — |
| Plans published | 1 | 1 |
| Spec score · Database Migration Tools | 8.5 (#5) | 8.0 (#11) |
| Installation | The project documents global installation with npm install -g db-migrate and local installation with npm install db-migrate. | The CLI can be installed with `cargo install sqlx-cli`. |
| License | The project is distributed under the MIT License. | The SQLx repository lists Apache-2.0 and MIT license files. |
| Purpose | db-migrate describes itself as a database migration framework for Node.js. | SQLx CLI is a command-line utility for managing databases and migrations and enabling offline mode for SQLx query macros. |
| Security | The repository page displays a Security and quality section with 0 findings. | The project README says SQLx forbids unsafe code unless the SQLite feature is enabled, where SQLite API calls use unsafe code that the maintainers welcome auditing and feedback on. |
| Support | The repository invites users to seek project support through backer and sponsor contributions. | The SQLx repository links to its FAQ and Discord community for questions. |
| Supported databases | The documentation lists MySQL, PostgreSQL, sqlite3, MongoDB, and CockroachDB as supported databases. | The CLI installation instructions say it supports the databases supported by SQLx; the project lists PostgreSQL, MySQL, MariaDB, and SQLite. |
Plans
In their own words
db-migrate
db-migrate is a free, open-source database migration framework for Node.js applications. It runs on Linux and can be self-hosted. The command-line interface provides up, down, reset, create, and db commands for applying, rolling back, resetting, creating, and managing migrations. Supported databases listed by the project include MySQL, PostgreSQL, sqlite3, MongoDB, and CockroachDB, with database drivers installed separately. Migration files support callback-based or promise-based interfaces, while the --sql-file option creates separate SQL files for migration-up and migration-down statements. Applied migrations are recorded in a migrations table. Environment settings can come from database.json, with command-line choices for the environment and configuration file. Database usernames and passwords can reference environment variables. Global and local npm installation are documented. Node.js 24 and newer are officially supported; package metadata specifies version 8.0.0 or later. Rollback is supported, and the format is mixed.
sqlx-cli
sqlx-cli is SQLx’s command-line utility for managing databases, migrations, and offline preparation for query macros. It can create or drop the database identified by a database URL, and create, run, inspect, or revert migrations, including paired up and down scripts. The `cargo sqlx prepare` command writes query metadata to a `.sqlx` directory. Once that metadata is checked into version control, builds can run without an active database connection. The `--check` option returns a nonzero status if the saved metadata is out of date, a behavior the project describes for continuous integration.
For workspaces whose crates use query macros, `cargo sqlx prepare --workspace` places one `.sqlx` directory at the workspace root. Commands accept the database URL through `--database-url`, the `DATABASE_URL` environment variable, or a `.env` file in the current directory. The project lists PostgreSQL, MySQL, MariaDB, and SQLite support, with installation options for database drivers and TLS backends. The CLI is free and open source under the user’s choice of Apache-2.0 or MIT license. The README notes that MSSQL support was removed pending a full driver rewrite.