pub struct Transaction<'a, C>where
C: Prepare + ClientBorrowMut,{ /* private fields */ }
Implementations§
Source§impl<C> Transaction<'_, C>where
C: Prepare + ClientBorrowMut,
impl<C> Transaction<'_, C>where
C: Prepare + ClientBorrowMut,
pub fn builder() -> TransactionBuilder
Sourcepub async fn bind<'p>(
&'p self,
statement: &'p Statement,
params: &[&(dyn ToSql + Sync)],
) -> Result<Portal<'p, C>, Error>
pub async fn bind<'p>( &'p self, statement: &'p Statement, params: &[&(dyn ToSql + Sync)], ) -> Result<Portal<'p, C>, Error>
Binds a statement to a set of parameters, creating a Portal
which can be incrementally queried.
Portals only last for the duration of the transaction in which they are created, and can only be used on the connection that created them.
Sourcepub async fn bind_raw<'p, I>(
&'p self,
statement: &'p Statement,
params: I,
) -> Result<Portal<'p, C>, Error>where
I: AsParams,
pub async fn bind_raw<'p, I>(
&'p self,
statement: &'p Statement,
params: I,
) -> Result<Portal<'p, C>, Error>where
I: AsParams,
A maximally flexible version of Transaction::bind
.
Sourcepub async fn transaction(&mut self) -> Result<Transaction<'_, C>, Error>
pub async fn transaction(&mut self) -> Result<Transaction<'_, C>, Error>
Like Client::transaction
, but creates a nested transaction via a savepoint.
Sourcepub async fn save_point<I>(
&mut self,
name: I,
) -> Result<Transaction<'_, C>, Error>
pub async fn save_point<I>( &mut self, name: I, ) -> Result<Transaction<'_, C>, Error>
Like Client::transaction
, but creates a nested transaction via a savepoint with the specified name.
Trait Implementations§
Source§impl<C> Drop for Transaction<'_, C>where
C: Prepare + ClientBorrowMut,
impl<C> Drop for Transaction<'_, C>where
C: Prepare + ClientBorrowMut,
Source§impl<C> Prepare for Transaction<'_, C>where
C: Prepare + ClientBorrowMut,
impl<C> Prepare for Transaction<'_, C>where
C: Prepare + ClientBorrowMut,
Source§impl<C> Query for Transaction<'_, C>where
C: Prepare + ClientBorrowMut,
impl<C> Query for Transaction<'_, C>where
C: Prepare + ClientBorrowMut,
Auto Trait Implementations§
impl<'a, C> Freeze for Transaction<'a, C>
impl<'a, C> RefUnwindSafe for Transaction<'a, C>where
C: RefUnwindSafe,
impl<'a, C> Send for Transaction<'a, C>where
C: Send,
impl<'a, C> Sync for Transaction<'a, C>
impl<'a, C> Unpin for Transaction<'a, C>
impl<'a, C> !UnwindSafe for Transaction<'a, C>
Blanket Implementations§
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