pub trait SqlTransaction: Send {
// Required methods
fn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
sql: &'life1 str,
params: &'life2 [SqlValue],
) -> Pin<Box<dyn Future<Output = Result<SqlRows, SqlError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
sql: &'life1 str,
params: &'life2 [SqlValue],
) -> Pin<Box<dyn Future<Output = Result<u64, SqlError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn commit<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
where Self: 'async_trait;
fn rollback<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
One transaction’s worth of work. Dropping it without commit must leave
the database unchanged (the engine rolls back).
Required Methods§
Sourcefn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
sql: &'life1 str,
params: &'life2 [SqlValue],
) -> Pin<Box<dyn Future<Output = Result<SqlRows, SqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
sql: &'life1 str,
params: &'life2 [SqlValue],
) -> Pin<Box<dyn Future<Output = Result<SqlRows, SqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Run a row-returning statement (e.g. SELECT), binding params to the
statement’s positional placeholders.
Sourcefn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
sql: &'life1 str,
params: &'life2 [SqlValue],
) -> Pin<Box<dyn Future<Output = Result<u64, SqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
sql: &'life1 str,
params: &'life2 [SqlValue],
) -> Pin<Box<dyn Future<Output = Result<u64, SqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Run a non-row statement (INSERT/UPDATE/DELETE/DDL), binding
params. Returns the number of affected rows (0 for DDL).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".