DefaultQueryGateway
The QueryGateway over one backend: schemaProvider supplies the schema every query is admitted against, filters and policies run at admission steps 1 and 2, and observer sees every outcome. One instance serves every caller.
With counts, the counts and paged totals are cached (QueryCountCache): admitted as ever, then served from the cache while the type's snapshot write checkpoint holds; a query served so ends its observation with the outcome ObservedOutcome.CACHED. A cache is keyed by aggregate type, not by model: give each model's gateways a cache of their own.
Each record a backend returns is masked by the schema's response masks; with records, it is read by records instead (the events model reads each event as its aggregate reads it now and masks it by its own schema). constraints are rules its policies add to the schema's, which describe lists after the schema's own (the events model's AGGREGATE_REQUIRED). model is the model it serves, which its observer is told of each query.
Constructors
Properties
Functions
The single-aggregate visibility check of the policy chain: record, the snapshot-shaped record of one aggregate a point read chose by selection (a state read by id, its version or its trace, or the aggregate of an events query), as caller may read it: admitted by the same caller scope and QueryPolicy restrictions and the model's default scope as a query, evaluated in memory, and masked; null when the caller may not read it, so a row a query hides is hidden from a read by id too. A gateway without policies admits every record.
The groups of query, streamed.
How many records query matches, bounded by its limit or its budget's.
One keyset page of the records query matches, with the cursor of the next one.
How this model can be queried on entry (the GET of the query route): the capability descriptor of the schema this gateway admits against, under the budget entryPolicy gives entry. defaultListSize is the list size the entry's adapter applies when a list query sends none, or null. Its version is the route's ETag.
The records query matches, streamed.
record, the snapshot-shaped record of one aggregate, masked as this model's records are and admitted by no policy: a state of the history of an aggregate admitRecord admitted, read as the aggregate is now.
One page of the records query matches, with its total as PagedQuery.total asks.
The first record query matches, or null when none does.
The records query matches as a resumable stream: keyset chunks of chunkSize records read one after the other, each record with the cursor token of its position, from strictly after the position after names when given. after is a token of this model and effective sort (a stream's or a cursor query's); any other is wow.query.invalid. The query is admitted like a cursor query, so a stream resumed with the same query from another node or after a restart reads on from the same place, under its caller's scope again; at most query's limit records are read (0: all of them), and its budget bounds neither the limit nor the chunks. Each chunk runs within the query's timeout and under one bulkhead permit, given back before its records are emitted. Chunks are not one snapshot: see chunks. Only for a query resumes.