pub struct TransactionAsync<'c> { /* private fields */ }Expand description
Database transaction.
Begin a transaction using the BackendConnection
transaction method.
Implementations§
Trait Implementations§
Source§impl ConnectionMethodsAsync for TransactionAsync<'_>
impl ConnectionMethodsAsync for TransactionAsync<'_>
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TransactionAsync<'_>: 'async_trait,
fn query<'c, 'life0, 'life1, 'life2, 'async_trait>(
&'c self,
table: &'life0 str,
columns: &'life1 [Column],
expr: Option<BoolExpr>,
limit: Option<i32>,
offset: Option<i32>,
sort: Option<&'life2 [Order]>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn BackendRows + 'c>, Error>> + Send + 'async_trait>>where
'c: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TransactionAsync<'_>: 'async_trait,
fn insert_returning_pk<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
table: &'life1 str,
columns: &'life2 [Column],
pkcol: &'life3 Column,
values: &'life4 [SqlValRef<'life5>],
) -> Pin<Box<dyn Future<Output = Result<SqlVal, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
TransactionAsync<'_>: 'async_trait,
Source§fn insert_only<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
table: &'life1 str,
columns: &'life2 [Column],
values: &'life3 [SqlValRef<'life4>],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
TransactionAsync<'_>: 'async_trait,
fn insert_only<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
table: &'life1 str,
columns: &'life2 [Column],
values: &'life3 [SqlValRef<'life4>],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
TransactionAsync<'_>: 'async_trait,
Like
insert_returning_pk but with no return value.Source§fn insert_or_replace<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
table: &'life1 str,
columns: &'life2 [Column],
pkcol: &'life3 Column,
values: &'life4 [SqlValRef<'life5>],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
TransactionAsync<'_>: 'async_trait,
fn insert_or_replace<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
table: &'life1 str,
columns: &'life2 [Column],
pkcol: &'life3 Column,
values: &'life4 [SqlValRef<'life5>],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
TransactionAsync<'_>: 'async_trait,
Insert unless there’s a conflict on the primary key column, in which case update.
fn update<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
table: &'life1 str,
pkcol: Column,
pk: SqlValRef<'life2>,
columns: &'life3 [Column],
values: &'life4 [SqlValRef<'life5>],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
TransactionAsync<'_>: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
table: &'life1 str,
pkcol: &'static str,
pk: SqlVal,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TransactionAsync<'_>: 'async_trait,
fn delete_where<'life0, 'life1, 'async_trait>(
&'life0 self,
table: &'life1 str,
expr: BoolExpr,
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TransactionAsync<'_>: 'async_trait,
Auto Trait Implementations§
impl<'c> Freeze for TransactionAsync<'c>
impl<'c> !RefUnwindSafe for TransactionAsync<'c>
impl<'c> Send for TransactionAsync<'c>
impl<'c> Sync for TransactionAsync<'c>
impl<'c> Unpin for TransactionAsync<'c>
impl<'c> !UnwindSafe for TransactionAsync<'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