From 96b3c8c7af1751b6174f32b2e9bbcc8da224f26c Mon Sep 17 00:00:00 2001 From: Michael Vlach Date: Sat, 20 Aug 2022 14:20:14 +0200 Subject: [PATCH] [query] Add rollback() to Transaction #49 (#50) * Update transaction_test.rs * Update transaction.rs --- src/transaction.rs | 4 ++++ tests/transaction_test.rs | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/transaction.rs b/src/transaction.rs index 668dacfbf..e1f3198df 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -12,6 +12,10 @@ impl Transaction { Ok(QueryResult::default()) } + pub fn rollback(self) -> Result { + Ok(QueryResult::default()) + } + pub fn transaction(&self) -> Transaction { Transaction::default() } diff --git a/tests/transaction_test.rs b/tests/transaction_test.rs index 286668ea2..64ee0197d 100644 --- a/tests/transaction_test.rs +++ b/tests/transaction_test.rs @@ -32,3 +32,10 @@ fn transaction_commit() { let transaction = db.transaction(); let _result: Result = transaction.commit(); } + +#[test] +fn transaction_rollback() { + let db = agdb::Db::default(); + let transaction = db.transaction(); + let _result: Result = transaction.rollback(); +}