TableCache<T> class

Constructors

TableCache({required String tableName, required RowDecoder<T> decoder, bool isEvent = false})

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasPrimaryKey → bool
final
isEvent → bool
final
isSubscribed → bool
no setter
lastBatch → ValueNotifier<TransactionBatch<T>?>
final
onDelete → Stream<TableDeleteEvent<T>>
Fires when a row is deleted from this table. See onInsert for broadcast/ordering semantics.
no setter
onInsert → Stream<TableInsertEvent<T>>
Fires when a row is inserted into this table. Broadcast — multiple subscribers each receive every event. No replay: late subscribers do not see past events. Fires synchronously during the transaction, before lastBatch fires.
no setter
onUpdate → Stream<TableUpdateEvent<T>>
Fires when a row is updated. oldRow and newRow are both provided on the event. See onInsert for broadcast/ordering semantics.
no setter
reconcileEvictionCount → int
Rows evicted by snapshot reconciliation: previously owned or retained under the arriving query set's tag, but absent from its snapshot.
no setter
rows → ValueNotifier<List<T>>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subscribed → Future<void>
Resolves when the server has delivered the initial subscription batch for this table. Completes exactly once; stays completed across reconnects. Resolves even for empty tables (no row-count gate). Throws SpacetimeDbSubscriptionException if the server rejects a subscription query that references this table by name.
no setter
sweepEvictionCount → int
Rows evicted by the unowned-row sweep that runs when a snapshot applies outside a reconnect window (stale disk-loaded rows).
no setter
tableName → String
final
unsubscribeEvictionCount → int
Rows evicted because their last owning query set was unsubscribed (dropQuerySet). Monotonic per table instance. Together with reconcileEvictionCount and sweepEvictionCount this lets a consumer distinguish explained cache shrinkage from anomalies.
no setter

Methods

clear() → void
Clears all rows from the cache
count() → int
Returns the number of rows in the cache
find(dynamic primaryKey) → T?
Finds a row by its primary key
iter() → Iterable<T>
Returns an iterable of all rows in the cache
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rowNotifier(dynamic primaryKey) → ValueNotifier<T?>
Returns a ValueNotifier that fires only when the row with this primaryKey changes. Fires when the row's value changes per == — a server touch that doesn't change any field is de-duplicated.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited