Skip to main content

transaction_sqlite

Function transaction_sqlite 

Source
pub async fn transaction_sqlite<F, T, E>(
    pool: &SqlitePool,
    f: F,
) -> Result<T, E>
where for<'a> F: FnOnce(&'a mut Transaction) -> TxFuture<'a, T, E>, E: From<Error>,
Expand description

Run an async closure inside a SQLite transaction against an explicit pool.

The SQLite-specific variant of transaction for callers that want to pin to SQLite regardless of what the ambient pool is, or that are running outside of App::build() (e.g. tests).

See transaction for the closure shape.