diff options
author | 2024-11-14 17:59:21 +0000 | |
---|---|---|
committer | 2024-11-14 17:59:21 +0000 | |
commit | 469a3ad33914f7eff6edc9ca7fabb12f2950da84 (patch) | |
tree | 2712ba2e927fb820b6aa58443c9227d1da24a03f /src/db/mod.rs | |
parent | b7a2265e9b29d8fa09f84f5213ef7f8ed3045ca6 (diff) | |
download | critch-469a3ad33914f7eff6edc9ca7fabb12f2950da84.tar.gz critch-469a3ad33914f7eff6edc9ca7fabb12f2950da84.tar.bz2 critch-469a3ad33914f7eff6edc9ca7fabb12f2950da84.zip |
database work
Diffstat (limited to 'src/db/mod.rs')
-rw-r--r-- | src/db/mod.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/db/mod.rs b/src/db/mod.rs index 97a5b25..79e8717 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -1,6 +1,11 @@ +use artists::Artists; +use artworks::Artworks; +use comments::Comments; use sqlx::{postgres::PgPoolOptions, Pool, Postgres}; +mod artists; mod artworks; +mod comments; #[derive(Clone)] pub struct Database(Pool<Postgres>); @@ -17,4 +22,16 @@ impl Database { Self(pool) } + + pub fn artists(&self) -> Artists { + Artists::new(self.0.clone()) + } + + pub fn artworks(&self) -> Artworks { + Artworks::new(self.0.clone()) + } + + pub fn comments(&self) -> Comments { + Comments::new(self.0.clone()) + } } |