delete method

Future<bool> delete({
  1. dynamic query,
})

Implementation

Future<bool> delete({query}) async {
  bool success = false;
  await database!.transaction(
    (txn) async {
      try {
        var batch = txn.batch();
        batch.rawQuery(query);
        await batch.commit(continueOnError: false);
        success = true;
      } catch (_) {
        success = false;
      }
    },
  );
  return success;
}