recordHlc method

  1. @override
Future<String?> recordHlc(
  1. String table,
  2. String key
)
override

The stored HLC string of the record at table/key — tombstoned or live — or null when no record exists.

Lets the sync layer tell a record that will actually change local state (incoming HLC newer) from a redelivery of something already held.

Implementation

@override
Future<String?> recordHlc(String table, String key) async {
  if (_db == null) return null;
  final rows = _open.select(
    'SELECT hlc FROM crdt_records WHERE collection = ? AND key = ?',
    [table, key],
  );
  return rows.isEmpty ? null : rows.first['hlc'] as String;
}