MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / begin

Method begin

sdk-rust/src/transaction.rs:64–76  ·  view source on GitHub ↗

Begin a new transaction This is called internally by `Session::transaction()`. The transaction will automatically roll back when dropped unless committed.

(session: &'conn Session)

Source from the content-addressed store, hash-verified

62 /// This is called internally by `Session::transaction()`.
63 /// The transaction will automatically roll back when dropped unless committed.
64 pub(crate) fn begin(session: &'conn Session) -> Result<Self> {
65 // Execute BEGIN TRANSACTION
66 session
67 .coordinator()
68 .process_query("BEGIN TRANSACTION", session.id())
69 .map_err(|e| Error::Transaction(format!("Failed to begin transaction: {}", e)))?;
70
71 Ok(Transaction {
72 session,
73 committed: false,
74 drop_behavior: DropBehavior::Rollback,
75 })
76 }
77
78 /// Execute a GQL statement within this transaction
79 ///

Callers

nothing calls this directly

Calls 4

process_queryMethod · 0.80
coordinatorMethod · 0.80
TransactionClass · 0.70
idMethod · 0.45

Tested by

no test coverage detected