Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions crates/engine/src/relational_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,19 @@ impl RelationalDB {
Ok(self.with_read_only(Workload::Internal, |tx| self.inner.program(tx))?)
}

/// Obtain the module associated with this database and the transaction
/// offset visible to the read.
///
/// Waiting for the returned offset to become durable proves that the
/// `st_module` row observed by this read is durable.
pub fn program_with_tx_offset(&self) -> Result<(Option<Program>, TxOffset), DBError> {
self.with_read_only(Workload::Internal, |tx| {
let program = self.inner.program(tx)?;
let tx_offset = tx.tx_offset().into_inner().saturating_sub(1);
Ok((program, tx_offset))
})
}

/// Read the set of clients currently connected to the database.
pub fn connected_clients(&self) -> Result<ConnectedClients, DBError> {
self.with_read_only(Workload::Internal, |tx| {
Expand Down
Loading