#[non_exhaustive]pub struct Savepoint<'t, 'c> { /* private fields */ }Expand description
A savepoint within an active transaction.
Created via Transaction::savepoint. The savepoint acts as a
sub-transaction: it can be released (committed) or rolled back independently
of the outer transaction.
§Drop behaviour
If the savepoint is not explicitly released or rolled back before it goes
out of scope, Drop cannot perform async I/O. Users should always call
release or rollback explicitly.
Implementations§
Source§impl<'t, 'c> Savepoint<'t, 'c>
impl<'t, 'c> Savepoint<'t, 'c>
Sourcepub async fn release(self) -> Result<()>
pub async fn release(self) -> Result<()>
Release the savepoint (like a commit for the nested scope).
Sourcepub async fn query(&mut self, sql: &str) -> Result<QueryResult>
pub async fn query(&mut self, sql: &str) -> Result<QueryResult>
Execute a query that returns rows, within the savepoint scope.
Sourcepub async fn execute(&mut self, sql: &str) -> Result<ExecuteResult>
pub async fn execute(&mut self, sql: &str) -> Result<ExecuteResult>
Execute a statement that does not return rows.
Sourcepub async fn query_params(
&mut self,
sql: &str,
params: &[&dyn ToSql],
) -> Result<QueryResult>
pub async fn query_params( &mut self, sql: &str, params: &[&dyn ToSql], ) -> Result<QueryResult>
Execute a parameterized query that returns rows.
Sourcepub async fn execute_params(
&mut self,
sql: &str,
params: &[&dyn ToSql],
) -> Result<ExecuteResult>
pub async fn execute_params( &mut self, sql: &str, params: &[&dyn ToSql], ) -> Result<ExecuteResult>
Execute a parameterized statement that does not return rows.
Sourcepub async fn prepare(&mut self, sql: &str) -> Result<PreparedStatement>
pub async fn prepare(&mut self, sql: &str) -> Result<PreparedStatement>
Prepare a statement within the savepoint scope.
Trait Implementations§
Auto Trait Implementations§
impl<'t, 'c> Freeze for Savepoint<'t, 'c>
impl<'t, 'c> !RefUnwindSafe for Savepoint<'t, 'c>
impl<'t, 'c> Send for Savepoint<'t, 'c>
impl<'t, 'c> Sync for Savepoint<'t, 'c>
impl<'t, 'c> Unpin for Savepoint<'t, 'c>
impl<'t, 'c> UnsafeUnpin for Savepoint<'t, 'c>
impl<'t, 'c> !UnwindSafe for Savepoint<'t, 'c>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more