summaryrefslogtreecommitdiffstats
path: root/src/db/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/mod.rs')
-rw-r--r--src/db/mod.rs17
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())
+ }
}