sqlx-cli review
A focused Rust CLI for SQL migrations, reversibility, database management, and CI checks.
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
sqlx-cli is a command-line utility for the SQLx Rust toolkit, designed for developers and teams managing SQL database schemas alongside Rust application code. It can create and drop databases, create and run SQL migrations, compare migration history, execute pending scripts, and revert applied migrations. Migration files use SQL, and the tool supports PostgreSQL, MySQL, and SQLite through Cargo feature flags. Its open-source, self-hosted model suits teams that prefer managing migration workflows from the command line and alongside application code.
The migration workflow is its clearest strength. sqlx-cli supports reversible migrations through generated up and down scripts, giving teams a defined path for applying and reverting schema changes. It also compares migration history and runs pending scripts, which helps keep database state aligned with migration files. Database creation and management are included in the same utility, keeping common schema tasks within the SQLx and Cargo workflow rather than requiring a separate migration product. Teams looking for SQL-based migrations with rollback support should find the feature set closely aligned with that need.
Its offline query metadata features extend the workflow beyond schema changes. sqlx-cli can prepare offline query metadata and check that metadata in continuous integration, making CI validation part of the published functionality. Database and TLS support are selected through Cargo feature flags, so the setup is tied to Rust package configuration and the chosen database engines. This is a focused choice for Rust teams already working with SQLx and Cargo. Teams seeking broad platform coverage or a wider integration ecosystem should consider a tool with a broader stated scope instead.
sqlx-cli pros and cons
- Where it wins
- Creates, runs, compares, and reverts SQL migrations
- Generates reversible up and down migration scripts
- Prepares and checks offline query metadata in CI
- Where it doesn't
- Focused on Rust and Cargo-based workflows
- Platform and integration coverage is limited
- Requires feature flags for database and TLS support
sqlx-cli fact sheet, pricing and score →
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.
Last updated · How we research and update