Package-level declarations

Types

Link copied to clipboard
class AfterNowFilter @InternalWowApi constructor(val field: QueryField<*>, val offset: String = ZERO_OFFSET, val timeZone: String? = null) : RelativeTimeFilter

The field is after now + offset; see BeforeNowFilter.

Link copied to clipboard
class AggregateIdFilter @InternalWowApi constructor(val value: String) : FilterExpression
Link copied to clipboard
Link copied to clipboard

A calendar part of an instant, with its fixed integer domain [min, max].

Link copied to clipboard

The calendar unit a date histogram buckets by.

Link copied to clipboard
class AggregationElement @InternalWowApi constructor(val path: QueryField<*>, val filter: FilterExpression = MatchAllFilter)
Link copied to clipboard

One numeric contribution per current root or expanded record, for data conforming to its numeric schema. FIELD selects the sole non-null numeric value; missing, empty and multi-valued fields do not contribute. Repeated numeric values remain separate values. BINARY computes finite doubles; it does not pair arrays or preserve arbitrary native numeric precision.

Link copied to clipboard

The arithmetic of a binary aggregation expression.

Link copied to clipboard

The function of a numeric metric over a group's values.

Link copied to clipboard

A dimension an aggregation groups its records by: a field's terms, a numeric histogram, a date histogram or a date part.

Link copied to clipboard

Where a group reads its field when the query expands elements; see AggregationGroup.scope.

Link copied to clipboard

A value an aggregation computes for each group, named by its alias.

Link copied to clipboard
class AggregationQuery @InternalWowApi constructor(val filter: FilterExpression = MatchAllFilter, elements: List<AggregationElement> = emptyList(), groupBy: List<AggregationGroup> = emptyList(), metrics: List<AggregationMetric>, sort: List<Sort> = emptyList(), val limit: Int = DEFAULT_LIMIT, val having: HavingExpression? = null) : FilterCapable<AggregationQuery> , SortCapable
Link copied to clipboard
Link copied to clipboard
class BeforeNowFilter @InternalWowApi constructor(val field: QueryField<*>, val offset: String = ZERO_OFFSET, val timeZone: String? = null) : RelativeTimeFilter

A moment relative to the server's clock: the field is before now + offset. The server resolves now once per query, so every condition of one query sees the same moment and the client's clock does not matter.

Link copied to clipboard
class BeforeTodayFilter @InternalWowApi constructor(val field: QueryField<*>, val time: String, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
class BetweenFilter @InternalWowApi constructor(val field: QueryField<*>, val lowerBound: Any?, val upperBound: Any?) : FieldPredicate
Link copied to clipboard

How an ignore-case contains, starts-with or ends-with compares letter case, on every backend: both texts after Unicode's simple case folding, character by character, with no language's own rules and nothing a store's locale, collation or version decides.

Link copied to clipboard

How an expression filter or a HAVING condition compares a computed value with its operand.

Link copied to clipboard
class ContainsAllFilter @InternalWowApi constructor(val field: QueryField<*>, values: List<Any?>) : FieldPredicate
Link copied to clipboard
class ContainsFilter @InternalWowApi constructor(val field: QueryField<*>, val value: String, val stringComparison: StringComparison = StringComparison.CASE_SENSITIVE) : FieldPredicate
Link copied to clipboard
class CountQuery @InternalWowApi constructor(val filter: FilterExpression = MatchAllFilter, val limit: Int? = null) : FilterCapable<CountQuery>

A bounded count of the matches of filter.

Link copied to clipboard
class CountResult @InternalWowApi constructor(val count: Long, val exact: Boolean)

The result of a CountQuery.

Link copied to clipboard
class CrossTenant @InternalWowApi constructor(tenantIds: Set<String>? = null)

The tenants a cross-tenant query reads: every tenant when tenantIds is null (ALL), else those. Only the HTTP edge states one, for a caller that may act across scopes and names Wow-Scope: tenant=* or tenant=("t1" "t2") while wow.query.allow-cross-tenant is on; trusted in-process code that must read every tenant uses NodeQueryApi.trusted(). A type whose tenant is fixed is still read in that tenant alone, and every cross-tenant query is audited, whether or not a QueryObserver audits.

Link copied to clipboard
class CursorPage<out T> @InternalWowApi constructor(val list: List<T>, val nextCursor: String?)
Link copied to clipboard
class CursorQuery @InternalWowApi constructor(val filter: FilterExpression = MatchAllFilter, val projection: Projection = Projection.ALL, sort: List<Sort> = emptyList(), val size: Int? = null, val cursor: String? = null) : Queryable<CursorQuery>

A query for the page of results after a cursor, in the order of sort, with filtering and projection (Queryable).

Link copied to clipboard

A fixed-length unit of elapsed time. Calendar units (months, years) have no fixed length and depend on a time zone, so they are not offered; a DAY is exactly 24 hours.

Link copied to clipboard
class DeletionFilter @InternalWowApi constructor(val deletionState: DeletionState) : FilterExpression

Filters by deletion state; deletionState is written as state on the wire.

Link copied to clipboard

Enumeration representing the possible states of deletion for entities in the system.

Link copied to clipboard

A derived metric's expression: computed from the group's other metrics, or over the groups as a window.

Link copied to clipboard
class EarlierDaysFilter @InternalWowApi constructor(val field: QueryField<*>, val days: Int, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
class ElementMatchFilter @InternalWowApi constructor(val field: QueryField<*>, val predicate: FilterExpression) : FieldPredicate
Link copied to clipboard
class EndsWithFilter @InternalWowApi constructor(val field: QueryField<*>, val value: String, val stringComparison: StringComparison = StringComparison.CASE_SENSITIVE) : FieldPredicate
Link copied to clipboard
class EqualFilter @InternalWowApi constructor(val field: QueryField<*>, value: Any?) : FieldPredicate
Link copied to clipboard
class ExistsFilter @InternalWowApi constructor(val field: QueryField<*>) : FieldPredicate
Link copied to clipboard
class ExpressionFilter @InternalWowApi constructor(val expression: AggregationExpression, val comparison: ComparisonOperator, val value: Double) : FilterExpression

Compares a computed expression, for example the hours from paidAt to shippedAt, with value. A record whose expression has no value (an operand is absent, or a division by zero) does not match, whatever the comparison. The expression is evaluated per record and cannot use an index, so the operator is expensive.

Link copied to clipboard
sealed interface FieldPredicate : FilterExpression

A filter on one field the request names: the comparison, string, membership, presence and relative-time predicates, and ELEMENT_MATCH, whose field is the collection its predicate applies to. System-field, logical, search and expression filters name no single field and are not field predicates.

Link copied to clipboard
sealed interface FilterCapable<Q : FilterCapable<Q>> : RewritableFilter<Q>

A query with a condition, its filter; a condition appended to it narrows that one.

Link copied to clipboard

A node of a filter tree. On the wire each node is a JSON object whose op is its operator's name, with the node's own properties beside it.

Link copied to clipboard

The operator of a filter node, its op on the wire.

Link copied to clipboard
class GreaterThanFilter @InternalWowApi constructor(val field: QueryField<*>, val value: Any?) : FieldPredicate
Link copied to clipboard
class GreaterThanOrEqualFilter @InternalWowApi constructor(val field: QueryField<*>, val value: Any?) : FieldPredicate
Link copied to clipboard

A condition on an aggregation's groups, read after their metrics are computed.

Link copied to clipboard
class IdFilter @InternalWowApi constructor(val value: String) : FilterExpression
Link copied to clipboard
class IdsFilter @InternalWowApi constructor(values: List<String>) : FilterExpression
Link copied to clipboard
class InFilter @InternalWowApi constructor(val field: QueryField<*>, values: List<Any?>) : FieldPredicate
Link copied to clipboard
class IsEmptyFilter @InternalWowApi constructor(val field: QueryField<*>) : FieldPredicate
Link copied to clipboard
class IsEmptyStringFilter @InternalWowApi constructor(val field: QueryField<*>) : FieldPredicate
Link copied to clipboard
class IsNotEmptyStringFilter @InternalWowApi constructor(val field: QueryField<*>) : FieldPredicate
Link copied to clipboard
class IsNotNullFilter @InternalWowApi constructor(val field: QueryField<*>) : FieldPredicate
Link copied to clipboard
class IsNullFilter @InternalWowApi constructor(val field: QueryField<*>) : FieldPredicate
Link copied to clipboard
class LastMonthFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
class LastWeekFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
class LastYearFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
class LessThanFilter @InternalWowApi constructor(val field: QueryField<*>, val value: Any?) : FieldPredicate
Link copied to clipboard
class LessThanOrEqualFilter @InternalWowApi constructor(val field: QueryField<*>, val value: Any?) : FieldPredicate
Link copied to clipboard
class ListQuery @InternalWowApi constructor(val filter: FilterExpression = MatchAllFilter, val projection: Projection = Projection.ALL, sort: List<Sort> = emptyList(), val limit: Int? = null) : Queryable<ListQuery>

A list query: the records its filter matches, in its order, with its projection, at most its limit.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class NextMonthFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
class NextWeekFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
class NextYearFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
Link copied to clipboard
class NotEqualFilter @InternalWowApi constructor(val field: QueryField<*>, value: Any?) : FieldPredicate
Link copied to clipboard
class NotExistsFilter @InternalWowApi constructor(val field: QueryField<*>) : FieldPredicate
Link copied to clipboard
class NotInFilter @InternalWowApi constructor(val field: QueryField<*>, values: List<Any?>) : FieldPredicate
Link copied to clipboard
class OrFilter @InternalWowApi constructor(operands: List<FilterExpression>) : FilterExpression
Link copied to clipboard
class OwnerIdFilter @InternalWowApi constructor(val value: String) : FilterExpression
Link copied to clipboard
class PagedList<out T> @InternalWowApi constructor(val total: Long?, val list: List<T>, val exact: Boolean = total != null)

One page of a paged query's results, and the total across every page.

Link copied to clipboard
class PagedQuery @InternalWowApi constructor(val filter: FilterExpression = MatchAllFilter, val projection: Projection = Projection.ALL, sort: List<Sort> = emptyList(), val pagination: Pagination = Pagination.DEFAULT, val total: TotalMode = TotalMode.BOUNDED) : Queryable<PagedQuery>

A paged query: one page of the records its filter matches, in its order, with its projection.

Link copied to clipboard
class Pagination @InternalWowApi constructor(val index: Int = 1, val size: Int = 10)

The page of results a paged query reads, and how many items a page holds. Pages are numbered from 1; the offset follows from the two.

Link copied to clipboard
enum class PagingMode : Enum<PagingMode>

How a query model's records may be read, as its descriptor lists them (record.paging), by wire name (list, paged, cursor): a list of the first records (ListQuery), a page by number (PagedQuery), or a page after a cursor (CursorQuery), which only a model with a unique sort offers.

Link copied to clipboard
class Projection @InternalWowApi constructor(include: List<QueryField<*>> = emptyList(), exclude: List<QueryField<*>> = emptyList())

The fields a query's results include or leave out.

Link copied to clipboard

Interface for query objects that support field projection.

Link copied to clipboard

Interface for query objects that support comprehensive querying capabilities.

Link copied to clipboard

Stable, machine-readable codes of rejected query requests, carried as the code of each of the rejection's violations (Violation.code). A contract: codes are added, never renamed or reused. Clients switch on them instead of on the human text.

Link copied to clipboard
sealed interface QueryField<T>

A logical field of a query model, by its path (state.price, aggregateId, items.0.sku), typed by the values T it holds: the DSL's comparisons take a value of that type, checked at compile time (STATE__PRICE gte BigDecimal("5.00")). The generated <State>Properties and <Context>Contract constants are typed by their state's fields; a dynamic key, named only at run time, is a QueryField<Any?> (QueryField of a path) and takes any value.

Link copied to clipboard

The structure of a query field's value, as a query model's descriptor writes it (kind), by wire name: scalar (a string, a number, a boolean or a time), object, array, union (more than one of these), null (only ever null), or unknown (not described). Schema declarations and storage metadata share it.

Link copied to clipboard
class RecentDaysFilter @InternalWowApi constructor(val field: QueryField<*>, val days: Int, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard

A window of time relative to the moment a query runs, such as today or the last seven days. Its days are read in timeZone; how the window's bounds are written is the field's: the encoding its schema declares (@QueryTemporal), an epoch in its unit or a text in its pattern.

Link copied to clipboard
sealed interface RewritableFilter<Q : RewritableFilter<Q>>

A query, or a filter, whose condition can be replaced (withFilter) or narrowed (appendFilter), each a new one.

Link copied to clipboard

Interface for query objects that support projection rewriting and modification.

Link copied to clipboard

What a DerivedExpression.Running window computes over its frame.

Link copied to clipboard
class SearchFilter @InternalWowApi constructor(val query: String, fields: Set<QueryField<*>> = emptySet(), val mode: SearchMode = SearchMode.TERMS) : FilterExpression
Link copied to clipboard
enum class SearchMode : Enum<SearchMode>

How a full-text search matches: its terms in any order, or its words as a phrase.

Link copied to clipboard
class SingleQuery @InternalWowApi constructor(val filter: FilterExpression = MatchAllFilter, val projection: Projection = Projection.ALL, sort: List<Sort> = emptyList()) : Queryable<SingleQuery>

Data class representing a query for retrieving a single item with optional filtering, projection, and sorting.

Link copied to clipboard

The fields of a snapshot record a query names, as QueryFields: the system fields and STATE, under which the aggregate's state lies. Each name is its path in upper snake case, a nested segment after __: OPERATOR__ID is operator.id.

Link copied to clipboard
class Sort @InternalWowApi constructor(val field: QueryField<*>, val direction: Sort.Direction)

A sorting criterion of query results: the field they are ordered by, and the direction.

Link copied to clipboard
sealed interface SortCapable

Interface for query objects that support sorting capabilities.

Link copied to clipboard
class SpaceIdFilter @InternalWowApi constructor(val value: String) : FilterExpression
Link copied to clipboard
class StartsWithFilter @InternalWowApi constructor(val field: QueryField<*>, val value: String, val stringComparison: StringComparison = StringComparison.CASE_SENSITIVE) : FieldPredicate
Link copied to clipboard

Whether a string filter compares case-sensitively.

Link copied to clipboard
class TenantIdFilter @InternalWowApi constructor(val value: String) : FilterExpression
Link copied to clipboard
class ThisMonthFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
class ThisWeekFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
class ThisYearFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
class TodayFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
class TomorrowFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter
Link copied to clipboard
enum class TotalMode : Enum<TotalMode>

How a paged query counts its total, the PagedList.total it returns.

Link copied to clipboard

The window functions of DerivedExpression.Window, as a storage declares and the descriptor lists them.

Link copied to clipboard
class YesterdayFilter @InternalWowApi constructor(val field: QueryField<*>, val timeZone: String? = null) : RelativeTimeFilter

Properties

Link copied to clipboard

The fields an expression reads, in tree order.

Link copied to clipboard

The computed input of a TERMS or HISTOGRAM group in place of its field, or null.

Link copied to clipboard

Functions

Link copied to clipboard

The direct child filters of this node: the operands of AND / OR / NOR and the predicate of ELEMENT_MATCH. Every other node is a leaf and returns an empty list. The one walker of a filter tree: consumers that visit the tree read the children from here instead of matching the logical nodes themselves.

Link copied to clipboard

Checks if this projection has no field filtering (includes all fields).

Link copied to clipboard

The field of path, untyped: a dynamic key, which takes any value.