1 unstable release

0.12.0 Jan 16, 2024

#111 in #diesel

Download history 33/week @ 2024-01-11 53/week @ 2024-01-18 70/week @ 2024-01-25 268/week @ 2024-02-01 178/week @ 2024-02-08 141/week @ 2024-02-15 202/week @ 2024-02-22 232/week @ 2024-02-29 159/week @ 2024-03-07 76/week @ 2024-03-14 112/week @ 2024-03-21 63/week @ 2024-03-28 54/week @ 2024-04-04 22/week @ 2024-04-11 9/week @ 2024-04-18

163 downloads per month
Used in 2 crates (via diesel_async_migrations)

MIT license

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

~84KB