Skip to content
SPECIFICTION
Get listed

golang-migrate vs sqlx-cli

golang-migrate

github.com

sqlx-cli

github.com

Side by side

Figuregolang-migratesqlx-cli
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WindowsYesYes
macOSYesYes
LinuxYesYes
Self-hostedYes—
Plans published11
Spec score · Database Migration Tools7.8 (#15)8.0 (#11)
Database supportListed database drivers include PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Neo4j, CockroachDB, and Google Cloud Spanner.Its default installation supports the databases supported by SQLx; installation options include PostgreSQL-only and SQLite-specific configurations.
LicenseThe project is distributed under the MIT License, which requires retaining the copyright and permission notices.The SQLx repository lists Apache-2.0 and MIT license files.
Purposegolang-migrate reads database migrations from sources and applies them to a database in order.SQLx CLI is a command-line utility for managing databases and migrations and enabling offline mode for SQLx query macros.

Plans

golang-migrate

  • Open sourceFree

golang-migrate pricing →

sqlx-cli

  • sqlx-cliFree

sqlx-cli pricing →

In their own words

golang-migrate

golang-migrate reads database migrations from a source and applies them to a database in sequence. Each logical migration has an up file and a down file, and the tool can run as a command-line program or be imported as a Go library. Listed database drivers include PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Neo4j, CockroachDB, and Google Cloud Spanner. Migration sources include local files, embedded Go data, GitHub, GitLab, Bitbucket, AWS S3, and Google Cloud Storage. The CLI handles Ctrl+C gracefully and does not use config search paths, config files, or automatic environment-variable injection. The library uses io.Reader streams for low memory overhead, is described as thread-safe without goroutine leaks, and supports controlled stopping through a GracefulStop channel to help prevent database corruption. The project documents running the CLI in Docker with a mounted migration directory. golang-migrate is open source under the MIT License and costs nothing. The security policy marks master and 4.x as supported; 3.x and earlier are unsupported.

Visit github.com

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.

Visit github.com