put method
Future<void>
put(
- String table,
- String key,
- Object? value, {
- bool isDeleted = false,
- CrdtType crdtType = const LwwRegister(),
override
crdtType is ignored: the crdt package's MapCrdt record shape has no
slot for it. Typed values are self-describing (they carry their own type
tag), so the TypedCrdtTable layer above still merges them correctly; a
persistent engine records the type as well.
Implementation
@override
Future<void> put(
String table,
String key,
Object? value, {
bool isDeleted = false,
CrdtType crdtType = const LwwRegister(),
}) async {
try {
await _crdt.put(table, key, value, isDeleted);
} on OverflowException {
// Same rule as the disk engine: move to the next microsecond rather
// than fail the write (see [incrementClock]).
_crdt.skipPastOverflow();
await _crdt.put(table, key, value, isDeleted);
}
}