transaction<T> abstract method
Runs the provided non-async function inside a transaction.
The function may not use async/await otherwise the transaction may commit before the queries are actually executed. This is a limitation of some adapters, that the function passed to the transaction runs "synchronously" through callbacks without releasing the event loop.
Implementation
Future<T> transaction<T>(
void Function(DbTransaction tx, void Function(T res)) setResult,
);