SnapshotQueries

The snapshot queries of an aggregate type: one row per aggregate, a Snapshot of its state S, and the latest state of an aggregate by its ref. A typed row reads the whole record: a query with a projection is refused, run it through dynamic.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun state(ref: AggregateRef): Snapshot<S>?

The latest committed state of the aggregate ref (its snapshot, else its log before the first one), as the public port's state read reads it: null when there is none or the reader may not see it, alike, and for a caller when ref is outside its tenant. Trusted code reads any tenant's.

abstract suspend fun state(ref: AggregateRef, minVersion: Int): Snapshot<S>?

The committed state of the aggregate ref at version minVersion or later (read your writes, me.ahoo.wow.api.result.CommandResult.version the version a command wrote): the latest state, its snapshot caught up with its log when the snapshot lags; null when the reader may not see it.