4 releases (breaking)

0.15.0 Sep 4, 2024
0.14.0 Aug 21, 2024
0.13.0 Aug 15, 2024
0.12.0 Jan 16, 2024

#1753 in Database interfaces

Download history 41/week @ 2024-11-26 38/week @ 2024-12-03 114/week @ 2024-12-10 130/week @ 2024-12-17 41/week @ 2024-12-24 109/week @ 2024-12-31 129/week @ 2025-01-07 150/week @ 2025-01-14 188/week @ 2025-01-21 70/week @ 2025-01-28 183/week @ 2025-02-04 221/week @ 2025-02-11 158/week @ 2025-02-18 127/week @ 2025-02-25 99/week @ 2025-03-04 96/week @ 2025-03-11

500 downloads per month
Used in db-pool

MIT license

10KB
190 lines

!!! UNOFFICIAL

Diesel Async Migrations

Handles Postgres migrations via async diesel

Example usage


pub const MIGRATIONS: diesel_async_migrations::EmbeddedMigrations = diesel_async_migrations::embed_migrations!();


async fn run_migrations(url: impl AsRef<str>) -> anyhow::Result<()> {
    let mut conn = AsyncConnection::establish(url.as_ref()).await?;
    MIGRATIONS.run_pending_migrations(&mut conn).await?;
    Ok(())
}


Build.rs

In order for Cargo to correctly pick up changes to migration directory. Add a build.rs:


fn main() {
    println!("cargo:rerun-if-changed=migrations");
}


Dependencies

~4.5MB
~89K SLoC