DVWarehouseSink class
The reference store destination: one collection per model in any database Dartvel runs on -- a SQL table or a document collection -- holding each record's newest state.
Written through the record operations every engine implements, never SQL, so a destination is another store the application could have used, configured by where it is rather than by what language it speaks.
What it demonstrates is the contract a real warehouse adapter has to keep, not a storage engine: changes applied by record version so out-of-order commits leave the newest row, deletes that remove rows, a key reused after a delete treated as a new record, erasures that no in-flight change can undo, and idempotent schema evolution. Rows land as they were written; there is no transformation.
A capture carries field names, not types. A field is stored as fieldType says, or else as its first value is: a whole number, a fraction, a flag, or text.
- Implemented types
Constructors
- DVWarehouseSink({required DVDatabaseAdapter database, String name = 'warehouse', DVFieldType fieldType(String model, String field)?})
Properties
- database → DVDatabaseAdapter
-
final
- deduplicates → bool
-
Applying a change twice is a no-op, because it is applied by version.
no setteroverride
- fieldType → DVFieldType Function(String model, String field)?
-
How
fieldofmodelis stored; inferred from its values when null.final - hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
backfillComplete(
String model, int throughSequence, {String? tenant}) → Future< void> -
A backfill copied every live row of
modelas ofthroughSequence; anything the destination holds that the backfill did not touch and no later change wrote is gone from the source.override -
erase(
List< DVCapturedChange> changes) → Future<void> -
Applies an erasure now, out of band, superseding every change to the
same records with a lower sequence -- including one already in flight.
override
-
evolve(
DVCaptureSchemaChange change) → Future< void> -
Adds or removes columns. Must be idempotent: a crash after it and before
the checkpoint delivers it again.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
DVCaptureBatch batch) → Future< void> -
Applies
batch. Throwing leaves the checkpoint where it was, and the whole batch is delivered again (DV-CDC-001).override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- tombstoneTable → const String