1 unstable release

0.12.0 Jan 16, 2024

#2164 in Database interfaces

Download history 59/week @ 2024-01-21 118/week @ 2024-01-28 315/week @ 2024-02-04 120/week @ 2024-02-11 129/week @ 2024-02-18 252/week @ 2024-02-25 186/week @ 2024-03-03 135/week @ 2024-03-10 59/week @ 2024-03-17 108/week @ 2024-03-24 62/week @ 2024-03-31 39/week @ 2024-04-07 11/week @ 2024-04-14 26/week @ 2024-04-21 85/week @ 2024-04-28 31/week @ 2024-05-05

158 downloads per month
Used in db-pool

MIT license

10KB
185 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

~10–20MB
~348K SLoC