use sqlx::sqlite::SqlitePool; use super::repo::Provider as _; use crate::error::BoxedError; pub struct Channels<'a> { db: &'a SqlitePool, } impl<'a> Channels<'a> { pub fn new(db: &'a SqlitePool) -> Self { Self { db } } pub async fn create(&self, name: &str) -> Result<(), BoxedError> { let mut tx = self.db.begin().await?; tx.channels().create(name).await?; tx.commit().await?; Ok(()) } }