later 0.0.49

Distributed Background jobs manager and runner for Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Regenerates the PostgreSQL schema snapshot used by `make schema`.

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let url = std::env::var("LATER_POSTGRES_SCHEMA_URL")?;
    let pool = sqlx::postgres::PgPoolOptions::new().connect(&url).await?;
    sqlx::query("DROP SCHEMA public CASCADE")
        .execute(&pool)
        .await?;
    sqlx::query("CREATE SCHEMA public").execute(&pool).await?;
    drop(pool);
    let _storage = later::storage::Postgres::new(&url).await?;
    Ok(())
}