#[cfg(any())]
pub mod coordinator;
#[cfg(any())]
pub mod lock;
#[cfg(any())]
pub mod log;
#[cfg(any())]
pub mod savepoint;
pub mod snapshot;
pub mod visibility;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum IsolationLevel {
ReadUncommitted,
ReadCommitted,
#[default]
SnapshotIsolation,
Serializable,
}
impl From<crate::storage::query::ast::IsolationLevel> for IsolationLevel {
fn from(level: crate::storage::query::ast::IsolationLevel) -> Self {
match level {
crate::storage::query::ast::IsolationLevel::ReadUncommitted => Self::ReadUncommitted,
crate::storage::query::ast::IsolationLevel::ReadCommitted => Self::ReadCommitted,
crate::storage::query::ast::IsolationLevel::SnapshotIsolation => {
Self::SnapshotIsolation
}
crate::storage::query::ast::IsolationLevel::Serializable => Self::Serializable,
}
}
}
#[cfg(any())]
pub use coordinator::{Transaction, TransactionManager, TxnConfig, TxnError, TxnHandle, TxnState};
#[cfg(any())]
pub use lock::{LockManager, LockMode, LockResult, LockWaiter};
#[cfg(any())]
pub use log::{LogEntry, LogEntryType, TransactionLog, WalConfig};
#[cfg(any())]
pub use savepoint::{Savepoint, SavepointManager};
pub use snapshot::{Snapshot, SnapshotManager, TxnContext, Xid, XID_NONE};
pub use visibility::is_visible;