iamsauravsharma/sqlx_migrator
iamsauravsharma/sqlx_migrator has 39 GitHub stars and 4 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-09 16:33 UTC. Last push 2026-10-23.
SQLX migration using Rust insted of SQL
What you can do
- Migrations as Rust values with parents, replaces and run_before.
- Operations as code, SQL strings or embedded SQL files.
- CLI (apply, revert, redo, list, repair, prune) and RunReport.
- Locking, failed migration tracking and hooks.
Measured star growth
- in 24h
- 0
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalSQLX migrator
A Rust library for writing SQLX migrations using Rust instead of SQL.
| License | Crates Version | Docs |
|---|---|---|
Supported databases: PostgreSQL, SQLite and MySQL.
Features
- Migrations as Rust values with parents,
replacesandrun_before. - Operations as code, SQL strings or embedded SQL files.
- CLI (
apply,revert,redo,list,repair,prune) andRunReport. - Locking, failed migration tracking and hooks.
- Sync from other migration tools.
Installation
Enable postgres, mysql or sqlite (and json for CLI JSON output):
sqlx_migrator = { version = "0.20.0", features = ["postgres"] }
Quick start
use sqlx_migrator::migrator::{Migrator, Plan};
use sqlx_migrator::vec_box;
struct CreateSample;
// an operation is a `(up, down)` pair of SQL strings, or implement `Operation`
// for code
sqlx_migrator::postgres_migration!(
CreateSample,
"main",
"create_sample",
vec_box![],
vec_box![(
"CREATE TABLE sample (id INTEGER PRIMARY KEY, name TEXT)",
"DROP TABLE sample"
)]
);
#[tokio::main]
async fn main() {
let pool = sqlx::PgPool::connect(&std::env::var("DATABASE_URL").unwrap())
.await
.unwrap();
let mut conn = pool.acquire().await.unwrap();
let mut migrator = Migrator::default();
migrator.add_migration(Box::new(CreateSample)).unwrap();
migrator.run(&mut *conn, &Plan::apply_all()).await.unwrap();
}
Documentation
See the crate docs for the guide, locking, CLI, hooks and sync.
Explore related projects
Asabeneh/30-Days-Of-Python
The 30 Days of Python programming challenge is a step-by-step guide to learn the Python programming language in 30 days. This challenge may take more than 100 days. Follow your own pace. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,486 starsgrafana/grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
77,790 starsredis/redis
For developers, who are building real-time data-driven applications, Redis is the preferred, fastest, and most feature-rich cache, data structure server, and document and vector query engine.
77,332 starsapache/superset
Apache Superset is a Data Visualization and Data Exploration Platform
75,455 stars