Skip to content

Class: AspectQueryExecutor

@flyze/lib-data-store 3.0.0-alpha.55· latest

Defined in: projects/lib-data-store/src/lib/flyze-api/gridify-filter/aspect.filter.ts:66

new AspectQueryExecutor(expression): AspectQueryExecutor

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:136

ExecutableQuery<AspectQueryFilterKeys, AspectQuery>

AspectQueryExecutor

AbstractQueryExecutor< AspectQueryBuilder, Aspect, AspectQueryFilterKeys, AspectQuery, Aspect_QueryContext, Aspect_RequiredSection >.constructor

readonly mapper: object

Defined in: projects/lib-data-store/src/lib/flyze-api/gridify-filter/aspect.filter.ts:74

Per-key resolver. Each entry can be a bare function (legacy) or a MapperDescriptor declaring multi-value, unsupported, or cross-section requires semantics.

aspectTypeId: object

index: object

kind: "localField"

name: string = 'selectByTypeId'

map: (model) => string

Aspect

string

aspectTypeName: object

map: (model, ctx) => string | undefined

Aspect

Aspect_QueryContext

string | undefined

requires: readonly ["aspectTypes"]

assetDescription: object

map: (model, ctx) => string | null | undefined

Aspect

Aspect_QueryContext

string | null | undefined

requires: readonly ["assets"]

assetFullName: object

index: object

kind: "localField"

name: string = 'selectByPath'

map: (model) => string

Aspect

string

assetId: object

index: object

kind: "localField"

name: string = 'selectByAssetId'

map: (model) => string

Aspect

string

assetTypeId: object

index: object

kind: "derived"

multi: boolean = true

map: (model, ctx) => string[]

Aspect

Aspect_QueryContext

string[]

multi: boolean = true

requires: readonly ["assets"]

assetTypeName: object

map: (model, ctx) => string[]

Aspect

Aspect_QueryContext

string[]

multi: boolean = true

requires: readonly ["assets", "assetTypes"]

createdAt: (model) => Date

Aspect

Date

customId: (model) => string | null | undefined

Aspect

string | null | undefined

hasTag: (model) => boolean

Aspect

boolean

id: object

index: object

kind: "localId"

map: (model) => string

Aspect

string

name: (model) => string

Aspect

string

ownerId: (model) => string | null | undefined

Aspect

string | null | undefined

ownerKind: (model) => "Group" | "User" | "Unknown" | "API" | "System"

Aspect

"Group" | "User" | "Unknown" | "API" | "System"

tagDisplayName: object

map: (_model) => undefined

Aspect

undefined

supported: boolean = false

tagId: object

map: (model) => string[]

Aspect

string[]

multi: boolean = true

updatedAt: (model) => Date

Aspect

Date

AbstractQueryExecutor.mapper

apply(rows, ctx?): Aspect[]

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:208

Single-call pipeline: filter → sort → paginate. Most consumers should use this; callers that need the unpaginated total should use applyWithCount instead.

readonly Aspect[]

Aspect_QueryContext

Aspect[]

AbstractQueryExecutor.apply


applyWithCount(rows, ctx?): object

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:213

Like apply, but also returns the post-filter / pre-pagination row count. Useful for paged grids that show a total record badge.

readonly Aspect[]

Aspect_QueryContext

object

items: Aspect[]

totalCount: number

AbstractQueryExecutor.applyWithCount


canExecute(): CanExecuteResult<AspectQueryFilterKeys, Aspect_RequiredSection>

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:148

Inspect the expression tree and report any keys/operators the executor cannot evaluate in-memory. Callers can use this to fall back to an API round-trip instead of subscribing to a selector that will silently return no rows.

CanExecuteResult<AspectQueryFilterKeys, Aspect_RequiredSection>

AbstractQueryExecutor.canExecute


protected eval_contains(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:235

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_contains


protected eval_default(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:237

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_default


protected eval_endsWith(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:233

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_endsWith


protected eval_equals(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:225

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_equals


protected eval_greaterThan(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:227

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_greaterThan


protected eval_greaterThanOrEqual(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:229

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_greaterThanOrEqual


protected eval_lessThan(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:228

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_lessThan


protected eval_lessThanOrEqual(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:230

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_lessThanOrEqual


protected eval_notContains(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:236

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_notContains


protected eval_notEndsWith(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:234

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_notEndsWith


protected eval_notEquals(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:226

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_notEquals


protected eval_notStartsWith(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:232

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_notStartsWith


protected eval_startsWith(val, value): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:231

any

string | number | boolean

boolean

AbstractQueryExecutor.eval_startsWith


filter(rows, ctx?): Aspect[]

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:188

Filter rows keeping only those that satisfy the executable expression. Equivalent to rows.filter(r => this.match(r, ctx)) but collocated with sort / paginate / apply for symmetry.

readonly Aspect[]

Aspect_QueryContext

Aspect[]

AbstractQueryExecutor.filter


filterResidual(rows, residualGroup, ctx?): Aspect[]

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:182

Filter rows against the residual AST returned by planBaseSet(). When the group has no leaves left, returns the input unchanged (copied) — the index intersection is already authoritative.

readonly Aspect[]

ExecutableGroup<AspectQueryFilterKeys>

Aspect_QueryContext

Aspect[]

AbstractQueryExecutor.filterResidual


protected mapValue(entry, expression_key, ctx?): unknown

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:224

Extract the value from the entry based on the expression key.

Aspect

The model entry to extract the value from.

AspectQueryFilterKeys

the key of the expression to map.

Aspect_QueryContext

optional context forwarded to the mapper.

unknown

AbstractQueryExecutor.mapValue


match(entry, ctx?): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:141

Evaluate the query against entry. The optional ctx is forwarded to every mapper invocation, enabling cross-model joins.

Aspect

Aspect_QueryContext

boolean

AbstractQueryExecutor.match


matchGroup(entry, group, ctx?): boolean

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:176

Same as match, but evaluates the supplied group instead of the top-level expression. Used by selectors to filter the narrowed base set against the residual AST returned by planBaseSet(). Returns true when the residual group has no leaves left to evaluate.

Aspect

ExecutableGroup<AspectQueryFilterKeys>

Aspect_QueryContext

boolean

AbstractQueryExecutor.matchGroup


paginate(rows): Aspect[]

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:202

Apply the { skip, take } window from the executable expression. take === null means “no limit” → returns the input slice (copy).

readonly Aspect[]

Aspect[]

AbstractQueryExecutor.paginate


planBaseSet(): BaseSetPlan<AspectQueryFilterKeys>

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:169

Walk the root expression group and extract every top-level leaf whose mapper carries an index hint and uses an index-eligible operator (Equal for single-valued mappers, Equal / Contains for multi). The remaining (residual) AST is what the executor still needs to evaluate row-by-row after the section narrowed the base set.

Behaviour & guarantees:

  • Only extracts when the root group’s operator is And. Or roots cannot be safely narrowed without re-introducing rows excluded by other branches.
  • Nested groups are never inlined — they stay in residualGroup as full sub-trees and the executor evaluates them as usual.
  • When every leaf at the root is consumed and there are no nested groups, residualGroup is an empty AND-group (tautologically true). Callers may use hasResidualFilter as a hint to skip the per-row filter pass entirely.
  • When no leaf is consumed, callers should fall back to the existing apply(selectAll()) path unchanged.

BaseSetPlan<AspectQueryFilterKeys>

AbstractQueryExecutor.planBaseSet


sort(rows, ctx?): Aspect[]

Defined in: node_modules/@flyze/lib-db-models/gridify-filter/abstract.executor.d.ts:197

Stable, multi-key sort driven by expression.orderBy. Reuses the mapper to resolve values (multi-valued mappers compare by their first element). Null-handling: nulls last for ascending, nulls first for descending. Clauses whose mapper is missing/supported:false are silently skipped — callers should pre-check with canExecute() when the order matters for correctness.

readonly Aspect[]

Aspect_QueryContext

Aspect[]

AbstractQueryExecutor.sort