summaryrefslogtreecommitdiff
path: root/src/channel
diff options
context:
space:
mode:
Diffstat (limited to 'src/channel')
-rw-r--r--src/channel/repo/channels.rs7
-rw-r--r--src/channel/repo/messages.rs5
2 files changed, 5 insertions, 7 deletions
diff --git a/src/channel/repo/channels.rs b/src/channel/repo/channels.rs
index fc52aa3..ab7489c 100644
--- a/src/channel/repo/channels.rs
+++ b/src/channel/repo/channels.rs
@@ -2,7 +2,6 @@ use std::fmt;
use sqlx::{sqlite::Sqlite, SqliteConnection, Transaction};
-use crate::error::BoxedError;
use crate::id::Id as BaseId;
pub trait Provider {
@@ -25,7 +24,7 @@ pub struct Channel {
impl<'c> Channels<'c> {
/// Create a new channel.
- pub async fn create(&mut self, name: &str) -> Result<Id, BoxedError> {
+ pub async fn create(&mut self, name: &str) -> Result<Id, sqlx::Error> {
let id = Id::generate();
let channel = sqlx::query_scalar!(
@@ -44,7 +43,7 @@ impl<'c> Channels<'c> {
Ok(channel)
}
- pub async fn by_id(&mut self, channel: Id) -> Result<Channel, BoxedError> {
+ pub async fn by_id(&mut self, channel: Id) -> Result<Channel, sqlx::Error> {
let channel = sqlx::query_as!(
Channel,
r#"
@@ -60,7 +59,7 @@ impl<'c> Channels<'c> {
Ok(channel)
}
- pub async fn all(&mut self) -> Result<Vec<Channel>, BoxedError> {
+ pub async fn all(&mut self) -> Result<Vec<Channel>, sqlx::Error> {
let channels = sqlx::query_as!(
Channel,
r#"
diff --git a/src/channel/repo/messages.rs b/src/channel/repo/messages.rs
index 2c89724..a30e6da 100644
--- a/src/channel/repo/messages.rs
+++ b/src/channel/repo/messages.rs
@@ -5,7 +5,6 @@ use sqlx::{sqlite::Sqlite, SqliteConnection, Transaction};
use super::channels::Id as ChannelId;
use crate::{
clock::DateTime,
- error::BoxedError,
id::Id as BaseId,
login::repo::logins::{Id as LoginId, Login, Logins},
};
@@ -37,7 +36,7 @@ impl<'c> Messages<'c> {
channel: &ChannelId,
body: &str,
sent_at: &DateTime,
- ) -> Result<BroadcastMessage, BoxedError> {
+ ) -> Result<BroadcastMessage, sqlx::Error> {
let id = Id::generate();
let sender = Logins::from(&mut *self.0).by_id(sender).await?;
@@ -78,7 +77,7 @@ impl<'c> Messages<'c> {
&mut self,
channel: &ChannelId,
resume_at: Option<&DateTime>,
- ) -> Result<Vec<BroadcastMessage>, BoxedError> {
+ ) -> Result<Vec<BroadcastMessage>, sqlx::Error> {
let messages = sqlx::query!(
r#"
select