summaryrefslogtreecommitdiffstats
path: root/src/db/mod.rs
blob: f010bf8cf65bbe7aab0148f0b3469de6d1931228 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod users;

use sqlx::{Pool, Postgres};

use self::users::Users;

#[derive(Clone)]
pub struct Database(Pool<Postgres>);

impl Database {
    pub fn new(pool: Pool<Postgres>) -> Self {
        Self(pool)
    }

    pub fn users(&self) -> Users {
        Users::new(self.0.clone())
    }
}