summaryrefslogblamecommitdiff
path: root/makima/src/db/mod.rs
blob: dbfeeabaa640bc7366237272edf9769ce8c4df21 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                             
//! Database module for PostgreSQL connectivity and models.

pub mod models;
pub mod repository;

use sqlx::postgres::PgPoolOptions;
use sqlx::PgPool;

/// Create a database connection pool.
pub async fn create_pool(database_url: &str) -> Result<PgPool, sqlx::Error> {
    PgPoolOptions::new()
        .max_connections(5)
        .connect(database_url)
        .await
}