MCPcopy Create free account
hub / github.com/Migorithm/rustiful-backend / begin

Method begin

library/src/adapters/database.rs:49–65  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

47 }
48
49 pub async fn begin(&mut self) -> ApplicationResult<()> {
50 match self.transaction.as_mut() {
51 None => {
52 self.transaction = Some(
53 self.pool
54 .begin()
55 .await
56 .map_err(|err| ApplicationError::DatabaseConnectionError(Box::new(err)))?,
57 );
58 Ok(())
59 }
60 Some(_trx) => {
61 println!("Transaction Begun Already!");
62 Err(ApplicationError::TransactionError)?
63 }
64 }
65 }
66
67 pub async fn commit(&mut self) -> ApplicationResult<()> {
68 if self.transaction.is_none() {

Callers 8

test_add_boardFunction · 0.45
test_get_boardFunction · 0.45
test_delete_boardFunction · 0.45
test_update_boardFunction · 0.45
test_create_commentFunction · 0.45
test_transaction_commitFunction · 0.45

Calls

no outgoing calls

Tested by 8

test_add_boardFunction · 0.36
test_get_boardFunction · 0.36
test_delete_boardFunction · 0.36
test_update_boardFunction · 0.36
test_create_commentFunction · 0.36
test_transaction_commitFunction · 0.36