pub struct Transaction<'a> { /* private fields */ }Expand description
A transaction wrapping CypherLite execute calls.
Phase 2: simplified transaction without WAL integration. Full rollback requires WAL integration (Phase 3).
Implementations§
Source§impl<'a> Transaction<'a>
impl<'a> Transaction<'a>
Sourcepub fn execute(&mut self, query: &str) -> Result<QueryResult, CypherLiteError>
pub fn execute(&mut self, query: &str) -> Result<QueryResult, CypherLiteError>
Execute a query within this transaction.
Sourcepub fn execute_with_params(
&mut self,
query: &str,
params: Params,
) -> Result<QueryResult, CypherLiteError>
pub fn execute_with_params( &mut self, query: &str, params: Params, ) -> Result<QueryResult, CypherLiteError>
Execute a query with parameters within this transaction.
Sourcepub fn commit(self) -> Result<(), CypherLiteError>
pub fn commit(self) -> Result<(), CypherLiteError>
Commit the transaction.
Sourcepub fn rollback(self) -> Result<(), CypherLiteError>
pub fn rollback(self) -> Result<(), CypherLiteError>
Rollback the transaction (discard changes). For Phase 2, this is a no-op since we don’t have WAL integration yet.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Transaction<'a>
impl<'a> !RefUnwindSafe for Transaction<'a>
impl<'a> Send for Transaction<'a>
impl<'a> Sync for Transaction<'a>
impl<'a> Unpin for Transaction<'a>
impl<'a> UnsafeUnpin for Transaction<'a>
impl<'a> !UnwindSafe for Transaction<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more