transaction<T> method
Calls in action must only be done using the transaction object using the database will trigger a dead-lock.
await database.transaction((txn) async {
// Ok
await txn.execute('CREATE TABLE Test1 (id INTEGER PRIMARY KEY)');
// DON'T use the database object in a transaction
// this will deadlock!
await database.execute('CREATE TABLE Test2 (id INTEGER PRIMARY KEY)');
});
Implementation
@override
Future<T> transaction<T>(Future<T> Function(sqlite.Transaction txn) action,
{bool? exclusive}) =>
throw _dbNotEnabled();