eraseRecord method
Removes every value the log holds for one record, and captures what an erasure left of it: a delete when it is gone, or its anonymized values when a retention kept it. Returns that change, published.
Implementation
Future<DVCapturedChange> eraseRecord(DVRecordTable table, Object key) async {
final String id = await recordErasure(table, key);
final List<Map<String, Object?>> rows = await _records.find(
logTable,
where: DVFilter.all(<DVFilter>[
DVFilter.equals('change_id', id),
DVFilter.isNotNull('change_seq'),
]),
);
if (rows.isEmpty) {
throw StateError(
'The erasure of ${table.table}[$key] was captured but not published; '
'destinations were not reached.',
);
}
return _changeFromRow(rows.first);
}