sqlx-cli
sqlx-cli: A focused Rust CLI for SQL migrations, reversibility, database management, and CI checks. Ranked #21 of 32 in Database Migration Tools by our editors (6.8/10); pricing: Open source; best for rust application teams using SQL migrations.
At a glance
- Editor score6.8 / 10
- PricingOpen source
- Best forRust application teams using SQL migrations
- Paid fromFree
- Rollback supportYes
- Facts checked20 Sep 2026

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
Our verdict on sqlx-cli
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.
Your product? Our editors can test sqlx-cli in depth and publish a review, labelled as paid · from $149/mo →
sqlx-cli pricing
sqlx-cli fact sheet
| Free plan | Not verified |
|---|---|
| Paid from | Free |
| Rollback support | Yes |
| Schema diff | Not verified |
| CI/CD automation | Yes |
| Supported databases | Not verified |
| Drift detection | Not verified |
| Self-hosted option | Yes |
| Migration format | Sql |
| Deployment | Self-hosted |
| Support | Docs |
| Built for | Solo, Small business, Mid-market, Enterprise (editorial estimate) |
| Pricing | Open source |
| Website | github.com |
| Facts checked | 20 Sep 2026 |
Alternatives to sqlx-cli
- FlywayA broad migration platform with free core commands and deeper controls in paid editions.9.4
- AtlasAffordable schema automation with strong migration controls and CI/CD support.9.2
- LiquibaseA governed migration workflow with changelogs, rollback, drift detection, and a free tier.9.1
See all sqlx-cli alternatives →
Used sqlx-cli? Be the first to review it
The editor score above is our own research. What this page doesn't have yet is a reader's view — what you used sqlx-cli for, what worked and what didn't. No stars are seeded and no review is paid for; an editor reads every one before it appears.
Write a reviewTwo minutes · verified accounts only · read by an editor before it appears
Featured on iTechGuides
sqlx-cli is listed in our Database Migration Tools directory. Add the badge to your site — it links back to this page.
<a href="https://www.itechguides.com/products/sqlx-cli/"><img src="https://www.itechguides.com/best/badge/sqlx-cli.svg" alt="Featured on iTechGuides" width="230" height="46"></a>
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
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


