diff options
Diffstat (limited to 'src/app.rs')
| -rw-r--r-- | src/app.rs | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -1,8 +1,10 @@ use sqlx::sqlite::SqlitePool; +use crate::{channel::app::Channels, index::app::Index, login::app::Logins}; + #[derive(Clone)] pub struct App { - pub db: SqlitePool, + db: SqlitePool, } impl App { @@ -10,3 +12,17 @@ impl App { Self { db } } } + +impl App { + pub fn index(&self) -> Index { + Index::new(&self.db) + } + + pub fn logins(&self) -> Logins { + Logins::new(&self.db) + } + + pub fn channels(&self) -> Channels { + Channels::new(&self.db) + } +} |
