summaryrefslogtreecommitdiff
path: root/src/repo/channel.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/repo/channel.rs')
-rw-r--r--src/repo/channel.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/repo/channel.rs b/src/repo/channel.rs
index efc2ced..ad42710 100644
--- a/src/repo/channel.rs
+++ b/src/repo/channel.rs
@@ -82,7 +82,10 @@ impl<'c> Channels<'c> {
Ok(channel)
}
- pub async fn all(&mut self) -> Result<Vec<Channel>, sqlx::Error> {
+ pub async fn all(
+ &mut self,
+ resume_point: Option<Sequence>,
+ ) -> Result<Vec<Channel>, sqlx::Error> {
let channels = sqlx::query_as!(
Channel,
r#"
@@ -92,8 +95,10 @@ impl<'c> Channels<'c> {
created_at as "created_at: DateTime",
created_sequence as "created_sequence: Sequence"
from channel
+ where coalesce(created_sequence <= $1, true)
order by channel.name
"#,
+ resume_point,
)
.fetch_all(&mut *self.0)
.await?;