Refinery review
A focused Rust toolkit for embedding and running versioned database migrations.
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
Refinery is an open-source database migration toolkit for Rust applications. It combines an embeddable Rust library with the refinery command-line interface, giving teams options for running versioned migrations from application code or a migration directory. Migrations can be written as SQL files or Rust modules, then embedded into application binaries when deployment benefits from packaging migration logic with the application. It runs on Windows, macOS, and Linux and supports self-hosted use.
Its strongest fit is Rust-centered migration execution. Refinery tracks applied migrations and related metadata in a schema-history table, checks for divergent and missing migrations, and supports both contiguous and non-contiguous versioning. Teams can choose synchronous or asynchronous execution and run migrations in individual or grouped transactions. These options make the toolkit suitable for applications that need migration behavior to be selected in code rather than handled only through an external workflow. The command-line interface also provides a separate path for teams that prefer directory-based execution.
Refinery offers a mixed migration format and supports rollback through an explicit forward migration that reverses an earlier change. It does not provide automatic down-migrations, so teams need to design and maintain those reversal steps themselves. That approach can suit projects that want rollback logic represented as versioned migrations, but it requires additional migration planning. Choose Refinery when a Rust application needs embedded execution, SQL and Rust migration support, history tracking, and configurable transaction modes. Consider another tool if automatic rollback commands or a migration system designed for a broader application ecosystem is the priority.
Refinery pros and cons
- Where it wins
- Embeds SQL or Rust migrations directly into application binaries
- Supports synchronous, asynchronous, and transaction-based execution
- Checks migration history for missing and divergent versions
- Where it doesn't
- Automatic down-migrations are not provided
- Migration execution is focused on Rust applications
- Rollback requires writing a new migration to undo changes
Refinery 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