pub type PgPool = sqlx::PgPool; pub async fn connect(url: &str) -> anyhow::Result { let pool = sqlx::postgres::PgPoolOptions::new() .max_connections(10) .connect(url) .await?; Ok(pool) } pub async fn run_migrations(pool: &PgPool) -> anyhow::Result<()> { sqlx::migrate!("./migrations").run(pool).await?; Ok(()) }