Skip to content

Commit 8fb997e

Browse files
committed
libsql: Add max_write_replication_index method to Database
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
1 parent 3da2a8b commit 8fb997e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

libsql/src/database.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,18 @@ cfg_replication! {
388388
t => Err(Error::FreezeNotSupported(format!("{:?}", t)))
389389
}
390390
}
391+
392+
/// Get the maximum replication index returned from a write performed using any connection created using this Database object.
393+
pub fn max_write_replication_index(&self) -> Option<FrameNo> {
394+
let index = self
395+
.max_write_replication_index
396+
.load(std::sync::atomic::Ordering::SeqCst);
397+
if index == 0 {
398+
None
399+
} else {
400+
Some(index)
401+
}
402+
}
391403
}
392404
}
393405

0 commit comments

Comments
 (0)