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<crate::storage::query::ast::IsolationLevel> for IsolationLevel {
42 fn from(level: crate::storage::query::ast::IsolationLevel) -> Self {
43 match level {
44 crate::storage::query::ast::IsolationLevel::ReadUncommitted => Self::ReadUncommitted,
45 crate::storage::query::ast::IsolationLevel::ReadCommitted => Self::ReadCommitted,
46 crate::storage::query::ast::IsolationLevel::SnapshotIsolation => {
47 Self::SnapshotIsolation
48 }
49 crate::storage::query::ast::IsolationLevel::Serializable => Self::Serializable,
50 }
51 }
52}
53
54#[cfg(any())]
55pub use coordinator::{Transaction, TransactionManager, TxnConfig, TxnError, TxnHandle, TxnState};
56#[cfg(any())]
57pub use lock::{LockManager, LockMode, LockResult, LockWaiter};
58#[cfg(any())]
59pub use log::{LogEntry, LogEntryType, TransactionLog, WalConfig};
60#[cfg(any())]
61pub use savepoint::{Savepoint, SavepointManager};
62pub use snapshot::{Snapshot, SnapshotManager, TxnContext, Xid, XID_NONE};
63pub use visibility::is_visible;