Skip to main content

Class: ExecutionContext

Defined in: packages/core/src/execution-context.ts:6

Holds the runtime variable bindings and translation tables for a single query execution.

Constructors​

Constructor​

new ExecutionContext(): ExecutionContext

Returns​

ExecutionContext

Properties​

translations​

translations: Map<PlanOperator, { external: VariableMap; scope: VariableMap; }>

Defined in: packages/core/src/execution-context.ts:12

Per-operator variable translation maps used to locate values in variableValues.


variableNames​

variableNames: ASTIdentifier[] = []

Defined in: packages/core/src/execution-context.ts:10

same structure as variableNames


variableValues​

variableValues: unknown[] = []

Defined in: packages/core/src/execution-context.ts:8

Flat array of runtime values indexed by the numeric part of each variable's ASTIdentifier.

Methods​

get()​

get(variable): unknown

Defined in: packages/core/src/execution-context.ts:26

Returns the current value of a variable.

Parameters​

ParameterTypeDescription
variableASTIdentifierASTIdentifier with a single numeric part used as the array index.

Returns​

unknown


getKeys()​

getKeys(operator): number[]

Defined in: packages/core/src/execution-context.ts:51

Get numeric keys for the schema of operator

Parameters​

ParameterType
operatorPlanTupleOperator

Returns​

number[]


getRenames()​

getRenames(sourceOp, targetOp): number[]

Defined in: packages/core/src/execution-context.ts:72

Compute addresses of sourceOp keys in targetOp scope.

Parameters​

ParameterType
sourceOpPlanTupleOperator
targetOpPlanTupleOperator

Returns​

number[]


getTranslation()​

getTranslation(operator, key): number

Defined in: packages/core/src/execution-context.ts:61

Returns the numeric index in variableValues for key within operator's translation.

Parameters​

ParameterType
operatorPlanOperator
key(string | number | symbol)[]

Returns​

number


set()​

set(variable, value): void

Defined in: packages/core/src/execution-context.ts:33

Sets the current value of a variable.

Parameters​

ParameterTypeDescription
variableASTIdentifierASTIdentifier with a single numeric part used as the array index.
valueunknown-

Returns​

void


setTuple()​

setTuple(item, keys): unknown[]

Defined in: packages/core/src/execution-context.ts:43

Sets the values of the item to the context variableValues.

Parameters​

ParameterTypeDescription
itemunknown[]The item to set.
keysnumber[]The keys to set.

Returns​

unknown[]

The unchanged item.