doTransaction<T> method
Execute all sql in a transaction. See BoxerTableTranslator.resetWithItems for example usage
Implementation
Future<T?> doTransaction<T>(Future<T?> Function(BoxerTableBase clone) action, {bool? exclusive}) {
return database.transaction<T?>((transaction) async {
BoxerTableBase? clone = cloneInstance;
assert(clone != null, '❗️❗️❗️You should implement the clone() method if u want use this [doTransaction] method');
if (clone == null) return null;
clone.transaction = transaction;
return action(clone);
}, exclusive: exclusive);
}