Skip to content

Commit

Permalink
[query] Add rollback() to Transaction #49 (#50)
Browse files Browse the repository at this point in the history
* Update transaction_test.rs

* Update transaction.rs
  • Loading branch information
michaelvlach authored Aug 20, 2022
1 parent a90b913 commit 96b3c8c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ impl Transaction {
Ok(QueryResult::default())
}

pub fn rollback(self) -> Result<QueryResult, QueryError> {
Ok(QueryResult::default())
}

pub fn transaction(&self) -> Transaction {
Transaction::default()
}
Expand Down
7 changes: 7 additions & 0 deletions tests/transaction_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ fn transaction_commit() {
let transaction = db.transaction();
let _result: Result<agdb::QueryResult, agdb::QueryError> = transaction.commit();
}

#[test]
fn transaction_rollback() {
let db = agdb::Db::default();
let transaction = db.transaction();
let _result: Result<agdb::QueryResult, agdb::QueryError> = transaction.rollback();
}

0 comments on commit 96b3c8c

Please sign in to comment.