1 unstable release

0.12.0 Jan 16, 2024

#111 in #diesel

Download history 129/week @ 2024-07-22 91/week @ 2024-07-29 77/week @ 2024-08-05 49/week @ 2024-08-12 147/week @ 2024-08-19 138/week @ 2024-08-26 76/week @ 2024-09-02 37/week @ 2024-09-09 79/week @ 2024-09-16 156/week @ 2024-09-23 79/week @ 2024-09-30 64/week @ 2024-10-07 114/week @ 2024-10-14 104/week @ 2024-10-21 139/week @ 2024-10-28 131/week @ 2024-11-04

496 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

~80KB