From d171a258ad2119e39cb715f8800031fff16967dc Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Tue, 1 Oct 2024 22:43:18 -0400 Subject: Provide a resume point to bridge clients from state snapshots to the event sequence. --- src/repo/channel.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/repo/channel.rs') 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, sqlx::Error> { + pub async fn all( + &mut self, + resume_point: Option, + ) -> Result, 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?; -- cgit v1.2.3