1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Transaction management for `ManifoldDB`.
//!
//! This module provides the [`TransactionManager`] and [`DatabaseTransaction`] types
//! that coordinate transactions across storage, graph indexes, and vector indexes.
//!
//! # Write Batching
//!
//! For high-throughput concurrent writes, the module provides [`BatchWriter`] which
//! groups multiple transactions into a single commit for improved performance.
//!
//! # Example
//!
//! ```ignore
//! use manifoldb::transaction::{TransactionManager, VectorSyncStrategy};
//! use manifoldb_storage::backends::RedbEngine;
//!
//! // Create the engine and manager
//! let engine = RedbEngine::open("db.redb")?;
//! let manager = TransactionManager::new(engine);
//!
//! // Write transaction
//! let mut tx = manager.begin_write()?;
//! tx.put_entity(&entity)?;
//! tx.commit()?;
//!
//! // Read transaction
//! let tx = manager.begin_read()?;
//! let entity = tx.get_entity(entity_id)?;
//! ```
//!
//! # Batched Writes
//!
//! ```ignore
//! use manifoldb::transaction::{BatchWriter, BatchWriterConfig};
//! use manifoldb_storage::backends::RedbEngine;
//! use std::sync::Arc;
//!
//! let engine = Arc::new(RedbEngine::open("db.redb")?);
//! let writer = BatchWriter::new(engine, BatchWriterConfig::default());
//!
//! // Multiple threads can use the batch writer concurrently
//! let mut tx = writer.begin();
//! tx.put("table", b"key", b"value")?;
//! tx.commit()?; // Batched with other concurrent commits
//! ```
pub use ;
pub use DatabaseTransaction;
pub use ;
pub use ;