Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/transaction.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use futures::{StreamExt, TryStreamExt};
use sqlx::Error;
use tracing::Instrument;

impl<'c, DB> crate::Transaction<'c, DB>
Expand All @@ -15,6 +16,16 @@ where
attributes: self.attributes.clone(),
}
}

/// Commits this transaction or savepoint.
pub async fn commit(self) -> Result<(), Error> {
self.inner.commit().await
}

/// Aborts this transaction or savepoint.
pub async fn rollback(self) -> Result<(), Error> {
self.inner.rollback().await
}
}

/// Implements `sqlx::Executor` for a mutable reference to a tracing-instrumented transaction.
Expand Down