liveKeys method

  1. @override
Set<String> liveKeys(
  1. String table,
  2. String prefix
)
override

All live (non-tombstoned) keys in table whose key starts with prefix.

Like liveFields but without values — returns only metadata so operations such as Collection.length can avoid I/O. Must be safe to call synchronously after init.

Implementation

@override
Set<String> liveKeys(String table, String prefix) {
  final map = _crdt.getMap(table);
  if (prefix.isEmpty) {
    return map.keys.where((k) => _crdt.get(table, k) != null).toSet();
  }
  return {
    for (final e in map.entries)
      if (e.key.startsWith(prefix) && _crdt.get(table, e.key) != null) e.key,
  };
}