pub struct SqliteStateMachine { /* private fields */ }Implementations§
Source§impl SqliteStateMachine
impl SqliteStateMachine
pub fn open( path: impl AsRef<Path>, cluster_id: &str, node_id: &str, epoch: u64, config_id: u64, ) -> Result<Self>
pub fn open_with_configuration( path: impl AsRef<Path>, cluster_id: &str, node_id: &str, epoch: u64, configuration_state: ConfigurationState, ) -> Result<Self>
pub fn open_existing(path: impl AsRef<Path>) -> Result<Self>
Sourcepub fn close_for_handoff(self) -> Result<()>
pub fn close_for_handoff(self) -> Result<()>
Closes a detached state machine so another owner can reopen the canonical database.
SQLite may retain empty WAL sidecars after the last connection closes on some filesystems. Once the WAL is checkpointed and the connection is closed, those sidecars are owned crash artifacts and must be removed before the strict reopen validation.
pub fn apply_entry(&self, entry: &LogEntry) -> Result<ApplyProgress>
pub fn apply_entry_with_result(&self, entry: &LogEntry) -> Result<ApplyOutcome>
pub fn get_value(&self, key: &str) -> Result<Option<String>>
pub fn query_sql( &self, query: &SqlStatement, max_rows: usize, max_bytes: usize, ) -> Result<SqlQueryResult>
pub fn query_sql_with_timeout( &self, query: &SqlStatement, max_rows: usize, max_bytes: usize, timeout: Duration, ) -> Result<SqlQueryResult>
pub fn validate_sql_write(&self, command: &SqlCommand) -> Result<()>
Sourcepub fn prepare_sql_batch_effect(
&self,
members: &[SqlBatchMember<'_>],
base_index: LogIndex,
base_hash: LogHash,
) -> Result<SqlBatchPreparation>
pub fn prepare_sql_batch_effect( &self, members: &[SqlBatchMember<'_>], base_index: LogIndex, base_hash: LogHash, ) -> Result<SqlBatchPreparation>
Prepares one physical QWAL v3 effect for the successful subset of an ordered SQL batch.
Each member runs inside its own savepoint nested under one outer SQLite transaction. A failed member is rolled back and reported at the same input position; later members still observe all prior successful members. Every successful member is bound into the effect as an ordered receipt template and is committed at the effect’s single log anchor.
pub fn prepare_put_effect( &self, request_id: &str, key: &str, value: &str, request_payload: &[u8], base_index: LogIndex, base_hash: LogHash, ) -> Result<Vec<u8>>
pub fn check_request( &self, request_id: &str, command_payload: &[u8], ) -> Result<Option<RequestOutcome>>
pub fn connection_pragmas(&self) -> Result<(String, i64)>
pub fn check_sql_request( &self, request_id: &str, command_payload: &[u8], ) -> Result<Option<(RequestOutcome, Option<SqlCommandResult>)>>
Sourcepub fn check_sql_requests(
&self,
requests: &[(&str, &[u8])],
) -> Result<Vec<SqlRequestLookup>>
pub fn check_sql_requests( &self, requests: &[(&str, &[u8])], ) -> Result<Vec<SqlRequestLookup>>
Checks unique SQL request ids with one bounded control-sidecar query.
Results preserve input order. A missing receipt is Ok(None), an exact
receipt is decoded into its original outcome and result, and a digest
conflict or invalid payload is returned in that member’s aligned slot.
Duplicate request ids are rejected before querying; callers that accept
aliases must deduplicate by id and fan the aligned result back out.
pub fn applied_index_value(&self) -> Result<LogIndex>
pub fn applied_hash_value(&self) -> Result<LogHash>
Sourcepub fn applied_tip(&self) -> Result<ApplyProgress>
pub fn applied_tip(&self) -> Result<ApplyProgress>
Returns the applied index and hash observed by one control-store snapshot.