1 unstable release

0.12.0 Jan 16, 2024

#2177 in Database interfaces

Download history 50/week @ 2024-01-24 238/week @ 2024-01-31 223/week @ 2024-02-07 138/week @ 2024-02-14 171/week @ 2024-02-21 226/week @ 2024-02-28 183/week @ 2024-03-06 81/week @ 2024-03-13 109/week @ 2024-03-20 69/week @ 2024-03-27 47/week @ 2024-04-03 31/week @ 2024-04-10 17/week @ 2024-04-17 31/week @ 2024-04-24 89/week @ 2024-05-01 20/week @ 2024-05-08

159 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
~350K SLoC