liveFields method
Returns all live (non-tombstoned) records in table whose key starts
with prefix, as a flat map of key → value.
Pass an empty prefix to scan the full table (used by Collection.all
and Collection.all). Pass a document-id prefix (e.g.
"$id\x1F") to narrow the read to a single document's field records —
a disk-backed adapter can use this to avoid loading the whole table.
Implementation
@override
Future<Map<String, Object?>> liveFields(String table, String prefix) {
final map = _crdt.getMap(table);
if (prefix.isEmpty) return Future.value(Map.of(map));
return Future.value({
for (final e in map.entries)
if (e.key.startsWith(prefix)) e.key: e.value,
});
}