writeTransaction<T> abstract method

Future<T> writeTransaction<T>(
  1. Future<T> callback(
    1. SqliteWriteContext tx
    )
)

Open a read-write transaction on this write context.

When called on a SqliteConnection, this takes a global lock - only one write write transaction can execute against the database at a time. This applies even when constructing separate SqliteDatabase instances for the same database file.

Statements within the transaction must be done on the provided SqliteWriteContext - attempting statements on the SqliteConnection instance will error. It is forbidden to use the SqliteWriteContext after the callback completes.

Implementation

Future<T> writeTransaction<T>(
    Future<T> Function(SqliteWriteContext tx) callback);