value method

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

Returns the live value for key in table, or null if absent or tombstoned.

Implementation

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