delete method

void delete(
  1. String key
)

Implementation

void delete(String key) {
  if (isClosed) {
    return;
  }

  _execute(
    (functions, transaction, database) {
      final valuePointer = ffi.calloc<MDB_val>();

      final response = functions.mdbDel(
        transaction,
        database.value,
        mdbFromUint8List(serialize(key)),
        valuePointer,
      );
      if (response == KEY_NOT_EXISTS) {
        print('Key [$key] do not exists and can not be deleted');
        return;
      }
      ErrorHandler(response);
    },
  );
}