use sqlx::sqlite::SqlitePool; use crate::{channel::app::Channels, index::app::Index, login::app::Logins}; #[derive(Clone)] pub struct App { db: SqlitePool, } impl App { pub fn from(db: SqlitePool) -> Self { 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) } }