reddb_server/storage/transaction/
mod.rs1#[cfg(any())]
17pub mod coordinator;
18#[cfg(any())]
19pub mod lock;
20#[cfg(any())]
21pub mod log;
22#[cfg(any())]
23pub mod savepoint;
24pub mod snapshot;
25pub mod visibility;
26
27#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
29pub enum IsolationLevel {
30 ReadUncommitted,
32 ReadCommitted,
34 #[default]
36 SnapshotIsolation,
37 Serializable,
39}
40
41impl From<reddb_rql::ast::IsolationLevel> for IsolationLevel {
42 fn from(level: reddb_rql::ast::IsolationLevel) -> Self {
43 match level {
44 reddb_rql::ast::IsolationLevel::ReadUncommitted => Self::ReadUncommitted,
45 reddb_rql::ast::IsolationLevel::ReadCommitted => Self::ReadCommitted,
46 reddb_rql::ast::IsolationLevel::SnapshotIsolation => Self::SnapshotIsolation,
47 reddb_rql::ast::IsolationLevel::Serializable => Self::Serializable,
48 }
49 }
50}
51
52#[cfg(any())]
53pub use coordinator::{Transaction, TransactionManager, TxnConfig, TxnError, TxnHandle, TxnState};
54#[cfg(any())]
55pub use lock::{LockManager, LockMode, LockResult, LockWaiter};
56#[cfg(any())]
57pub use log::{LogEntry, LogEntryType, TransactionLog, WalConfig};
58#[cfg(any())]
59pub use savepoint::{Savepoint, SavepointManager};
60pub use snapshot::{Snapshot, SnapshotManager, TxnContext, Xid, XID_NONE};
61pub use visibility::is_visible;