AccessFilters

An access predicate (AccessPredicate) as a filter of the query algebra, which every backend pushes down: the predicate read in negation normal form, each comparison on the field its attribute is stored under in the model queried, as fieldOf says.

  • A comparison holds of a present value, and so does its negation, guarded by IS_NOT_NULL of its field: an absent value, or a record holding none, grants neither way, on every backend alike (SQL's three-valued NOT and a document store's missing fields agree only so). The check of absence, IS_NULL, is the one comparison of no value; its negation is IS_NOT_NULL.

  • A comparison with a claim the caller does not hold (AccessPredicate.Unknown), or of an attribute the model does not store (fieldOf null, a dataset with no column for it), matches nothing, negated or not.

  • One value: EQUAL is EqualFilter, IN InFilter and STARTS_WITH StartsWithFilter. Several: CONTAINS is ContainsAllFilter of the one value, CONTAINS_ANY an OrFilter of those, and IS_EMPTY an IsEmptyFilter of a present field. An enum's value is compared as the name Jackson writes for it, and an integer as a long, as the records store them.

It agrees with AccessPredicate.allows, which the kernel evaluates: the query TCK's AccessFilterSpec holds every backend, the in-memory one among them, to it.

Functions

Link copied to clipboard
fun compile(predicate: AccessPredicate, fieldOf: (AccessAttribute<*, *>) -> QueryField<*>?): FilterExpression

predicate as a filter, each attribute compared on fieldOf of it, or matching nothing where that is null.

Link copied to clipboard

predicate as a filter whose comparisons comparisonOf builds, each matching nothing where it gives none: for a model that holds an attribute as a filter of its own rather than as a field, such as the owner and the space of a snapshot or a dataset row (me.ahoo.wow.api.query.OwnerIdFilter, me.ahoo.wow.api.query.SpaceIdFilter) under the default rule (me.ahoo.wow.api.access.ScopeAccess). comparisonOf builds a comparison as it is: a negated one matches nothing.