use sqlx::{PgPool}; use anyhow::*; use sqlx::postgres::PgPoolOptions; #[derive(Clone)] pub struct DBApplication { pool: PgPool } impl DBApplication { pub async fn new(config: String) -> Result { let pool = PgPoolOptions::new() .max_connections(5) .connect(&config) .await?; Ok(DBApplication { pool }) } }