# rust-db/refinery

Powerful SQL migration toolkit for Rust.

Repository: https://github.com/rust-db/refinery
Canonical: https://ross.abutalabs.com/products/refinery
Language: Rust
License: MIT
License Family: permissive
Topics: rust, database-migrations, database-tools, barrel, sql-migration
Last push: 2026-08-24T19:54:48+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 87, longevity 100
- inputs: {"age_days": 3157, "days_push": 9, "days_rel": 84, "gap_med": 28.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1696, forks 161 (observed 2026-08-28T04:05:23.903335+00:00)

## What it is
Refinery is a SQL database migration toolkit for Rust that runs versioned migrations on database connections, either embedded in Rust code via macros or through a standalone CLI. It supports postgres, tokio-postgres, mysql, mysql_async, rusqlite, and tiberius drivers, and integrates with Barrel for programmatic schema generation.

## Use cases
- run sql migrations in a rust application
- version database schema changes for postgres
- embed migrations in rust binary
- migrate sqlite database schema from rust
- run database migrations via cli
- generate schema migrations with barrel
- async database migrations with tokio-postgres

## When to choose
- you are building a Rust application that needs versioned SQL schema migrations
- you need migrations embedded in your binary or runnable from a CLI
- you use postgres, mysql, sqlite, or mssql with Rust drivers
- you want programmatic schema generation with Barrel

## When to avoid
- you use SQLx and prefer its built-in migration tooling
- you need migrations for non-Rust stacks or polyglot projects
- you need NoSQL or ORM-managed schema evolution

## Facets
- artifact type: library
- maturity: stable
- function: database, orm, cli
- domain: databases, developer-tools, backend
- platform: rust, windows, cli
- tags: sql-migrations, database-migrations, schema-migration, postgres, mysql, sqlite, mssql, barrel, linux, macos

## Member repositories
- rust-db/refinery (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:23.903335+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:37:54.763769+00:00, confidence not recorded.
  - readme: https://github.com/rust-db/refinery (fetched 2026-08-28T04:05:23.903335+00:00, sha 764f668478ae)
  - registry_crates: https://crates.io/api/v1/crates/refinery (fetched 2026-08-29T11:12:41.127731+00:00, sha ccfa97ba76fc)
- Data as of 2026-08-30T08:39:29.467469+00:00.
