batchCommit method

Future<List?> batchCommit({
  1. bool? exclusive,
  2. bool? noResult,
  3. bool? continueOnError,
})

Commits all of the operations in this batch as a single atomic unit

The result is a list of the result of each operation in the same order if noResult is true, the result list is empty (i.e. the id inserted the count of item changed is not returned.

The batch is stopped if any operation failed If continueOnError is true, all the operations in the batch are executed and the failure are ignored (i.e. the result for the given operation will be a DatabaseException)

Implementation

Future<List<dynamic>?> batchCommit(
    {bool? exclusive, bool? noResult, bool? continueOnError}) async {
  if (openedBatch[_dbModel!.databaseName!] != null) {
    final retVal = await openedBatch[_dbModel!.databaseName!]!.commit(
        exclusive: exclusive,
        noResult: noResult,
        continueOnError: continueOnError);
    openedBatch[_dbModel!.databaseName!] = null;
    return retVal;
  } else {
    return null;
  }
}