uqa_execution/row_locks/
session.rs1use super::{LockAcquire, PhysicalRowChangeTarget, RowChangeTarget, RowLockManager};
10use std::sync::Arc;
11use uqa_core::DocId;
12use uqa_sql::{
13 ast::{LockStrength, LockWait},
14 SQLError,
15};
16
17pub trait RowLockSession {
19 fn lock_manager(&self) -> Arc<RowLockManager>;
20 fn lock_row(
21 &self,
22 table: &str,
23 doc_id: DocId,
24 strength: LockStrength,
25 wait: LockWait,
26 display_name: &str,
27 ) -> Result<LockAcquire, SQLError>;
28 fn uses_fixed_snapshot(&self) -> bool;
29 fn committed_row_successor(
30 &self,
31 table: &str,
32 doc_id: DocId,
33 ) -> Result<RowChangeTarget, SQLError>;
34 fn committed_physical_row_successor(
35 &self,
36 table: &str,
37 doc_id: DocId,
38 ) -> Result<PhysicalRowChangeTarget, SQLError>;
39 fn table_for_lock_hash(&self, table_hash: u64) -> Result<String, SQLError>;
40}