Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aljazerzen committed Jan 10, 2025
1 parent 2c68f31 commit 0e0ba31
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions edgedb-tokio/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ pub struct StandaloneTransaction {
}

impl StandaloneTransaction {
/// Commit the transaction.
///
/// If this method is not called, the transaction rolls back
/// when [StandaloneTransaction] is dropped.
pub async fn commit(mut self) -> Result<(), Error> {
if let Some(tran) = self.inner.take() {
tran.commit().await
Expand All @@ -53,6 +57,7 @@ impl StandaloneTransaction {
}
}

/// Rollback the transaction.
pub async fn rollback(mut self) -> Result<(), Error> {
if let Some(tran) = self.inner.take() {
tran.rollback().await
Expand Down

0 comments on commit 0e0ba31

Please sign in to comment.