rhythm-backend/src/db/database.rs
2026-04-16 11:56:27 +02:00

10 lines
284 B
Rust

use sqlx::{PgPool, postgres::PgPoolOptions};
pub async fn create_pool(database_url: &str) -> Result<PgPool, crate::error::AppError> {
PgPoolOptions::new()
.max_connections(10)
.connect(database_url)
.await
.map_err(crate::error::AppError::from)
}