transaction<T> abstract method

Future<T> transaction<T>(
  1. Future<T> action(
    1. AnySqlTransaction transaction
    )
)

Runs work inside a database transaction.

Implementations commit when action completes and roll back when it throws. Nested transactions and savepoints are not part of the shared contract; drivers may reject or define their own behavior for them.

Implementation

Future<T> transaction<T>(
  Future<T> Function(AnySqlTransaction transaction) action,
);