QueryModelProfile

Record layout and invariants of one QueryModel: the built-in Snapshot, and each declared dataset (DatasetQueryModelProfile). The hierarchy is closed to this module: its constructor is internal.

Every model difference that the query runtime depends on lives here, so gateways, validators and backends ask the profile instead of branching on QueryModel themselves. A schema carries its profile (QueryModelSchema.profile); other custom models have none, and operations that need one of these facts reject them.

Inheritors

Types

Link copied to clipboard

Properties

Link copied to clipboard

The fields that identify one record across the whole model, in the order a cursor appends them as its tie-breakers: the identityField alone by default, or nothing when the model has none.

Link copied to clipboard
abstract val eventTimeField: QueryField<*>?

When the record last changed: the default orderBy of FIRST and LAST metrics; null when there is none.

Link copied to clipboard
open val firstEventTimeField: QueryField<*>? = null

When the record's aggregate got its first event, or null when a record does not say.

Link copied to clipboard
open val fixedTenantId: String? = null

The one tenant every record belongs to, for a model with no tenant field (a platform-level dataset); null otherwise. A tenant filter then matches every record when it names this tenant and none when it names another, and it pins requiredScope.

Link copied to clipboard
abstract val identityField: QueryField<*>?

Unique record identity: the target of id filters and the tie-breaker of every cursor; null when the model declares none, which rejects both.

Link copied to clipboard
Link copied to clipboard
abstract val payloadField: QueryField<*>?

Logical field that holds the user payload; schema extensions must live below it. null when the whole record is payload, as in a dataset.

Link copied to clipboard
abstract val requiredScope: QueryField<*>

The field an authenticated caller scope must pin when requireAuthenticatedScope is on: the tenant, the isolation boundary of every built-in model.

Link copied to clipboard

Fields that every record of this model carries, independent of the aggregate.

Functions

Link copied to clipboard

Returns the scope appended to a query whose filter does not scope it explicitly, or MatchAllFilter when the model has no implicit scope.

Link copied to clipboard

The logical field a system-field filter (ID, TENANT_ID, DELETION, ...) targets: identityField for the record identity; null when the model does not carry field.

Link copied to clipboard
open fun validateProjection(projection: Projection)

Rejects a projection that would return records the model cannot interpret.