use anyhow::{Context, Result}; use sqlx::postgres::PgPoolOptions; use sqlx::PgPool; use std::time::Duration; pub async fn create_pool(database_url: &str) -> Result { PgPoolOptions::new() .max_connections(8) .acquire_timeout(Duration::from_secs(5)) .connect(database_url) .await .context("failed to connect to PostgreSQL") }