pub trait ConnectionMethodsAsync: AsyncRequiresSyncAsync {
// Required methods
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,
Self: '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,
Self: '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,
Self: '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,
Self: '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,
Self: 'async_trait;
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,
Self: '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,
Self: 'async_trait;
fn has_table<'life0, 'life1, 'async_trait>(
&'life0 self,
table: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
// Provided method
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,
Self: Sync + 'async_trait { ... }
}Expand description
Methods available on a database connection. Most users do not need
to call these methods directly and will instead use methods on
DataObject or the query! macro. This trait is
implemented by both database connections and transactions.
Required Methods§
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,
Self: '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,
Self: '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,
Self: 'async_trait,
Sourcefn 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,
Self: '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,
Self: 'async_trait,
Like insert_returning_pk but with no return value.
Sourcefn 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,
Self: '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,
Self: '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,
Self: '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,
Self: 'async_trait,
Provided Methods§
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,
Self: Sync + 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".