1 unstable release

0.12.0 Jan 16, 2024

#1966 in Database interfaces

Download history 51/week @ 2024-01-13 54/week @ 2024-01-20 110/week @ 2024-01-27 330/week @ 2024-02-03 121/week @ 2024-02-10 112/week @ 2024-02-17 254/week @ 2024-02-24 185/week @ 2024-03-02 149/week @ 2024-03-09 58/week @ 2024-03-16 110/week @ 2024-03-23 57/week @ 2024-03-30 42/week @ 2024-04-06 16/week @ 2024-04-13

237 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–21MB
~350K SLoC