summaryrefslogtreecommitdiffstats
path: root/src/db/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/db/mod.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/db/mod.rs b/src/db/mod.rs
new file mode 100644
index 0000000..f010bf8
--- /dev/null
+++ b/src/db/mod.rs
@@ -0,0 +1,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())
+ }
+}