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

#1449 in Database interfaces

Download history 97/week @ 2024-08-02 121/week @ 2024-08-09 262/week @ 2024-08-16 174/week @ 2024-08-23 170/week @ 2024-08-30 51/week @ 2024-09-06 43/week @ 2024-09-13 61/week @ 2024-09-20 54/week @ 2024-09-27 31/week @ 2024-10-04 66/week @ 2024-10-11 74/week @ 2024-10-18 97/week @ 2024-10-25 133/week @ 2024-11-01 53/week @ 2024-11-08 78/week @ 2024-11-15

368 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
~90K SLoC