Skip to main content

Class: LangSwitch

Defined in: lang-sql/src/plan/langswitch.ts:11

This operator is a temporary operator which is replaced in SchemaInferrer.

Extends

Constructors

Constructor

new LangSwitch(lang, node, langCtx): LangSwitch

Defined in: lang-sql/src/plan/langswitch.ts:19

Parameters

ParameterTypeDescription
langLowercase<string>-
nodeLangSwitchThe AST node containing the embedded language-switch expression.
langCtxRecord<string, unknown> & objectShared cross-language context; the sql entry holds the current SQLLangCtx.

Returns

LangSwitch

Overrides

PlanTupleOperator.constructor

Properties

lang

lang: Lowercase<string>

Defined in: core/dist/plan/visitor.d.ts:36

PlanOperator.lang

Inherited from

PlanTupleOperator.lang


langCtx

langCtx: Record<string, unknown> & object

Defined in: lang-sql/src/plan/langswitch.ts:24

Shared cross-language context; the sql entry holds the current SQLLangCtx.

Type Declaration

sql

sql: SQLLangCtx

The SQL-specific language context for the current query scope.


node

node: LangSwitch

Defined in: lang-sql/src/plan/langswitch.ts:22

The AST node containing the embedded language-switch expression.


parent?

optional parent?: PlanOperator

Defined in: core/dist/plan/visitor.d.ts:38

PlanOperator.parent

Inherited from

PlanTupleOperator.parent


requiredCol

requiredCol: ASTIdentifier

Defined in: lang-sql/src/plan/langswitch.ts:17

IN optimization needs information about the first returned column. The schema is not known at that point, so we create a new column which is required to be returned by the subquery.


schema

schema: ASTIdentifier[]

Defined in: core/dist/plan/visitor.d.ts:32

Ordered list of attribute identifiers produced by this operator.

Inherited from

PlanTupleOperator.schema


schemaSet

schemaSet: IdSet

Defined in: core/dist/plan/visitor.d.ts:34

Trie-backed set of the same paths as schema; used for O(k) membership tests.

Inherited from

PlanTupleOperator.schemaSet

Methods

accept()

accept<Ret, Arg>(visitors, arg?): Ret

Defined in: lang-sql/src/plan/langswitch.ts:35

Dispatches this operator to the SQL plan visitor for the active language.

Type Parameters

Type Parameter
Ret
Arg

Parameters

ParameterType
visitorsRecord<string, SQLPlanVisitor<Ret, Arg>>
arg?Arg

Returns

Ret

Overrides

PlanTupleOperator.accept


addToSchema()

addToSchema(item): void

Defined in: core/dist/plan/visitor.d.ts:46

will preserve object references

Parameters

ParameterType
itemASTIdentifier | ASTIdentifier[] | IdSet

Returns

void

Inherited from

PlanTupleOperator.addToSchema


clearSchema()

clearSchema(): void

Defined in: core/dist/plan/visitor.d.ts:50

will preserve object references

Returns

void

Inherited from

PlanTupleOperator.clearSchema


clone()

clone(): LangSwitch

Defined in: lang-sql/src/plan/langswitch.ts:57

Returns a deep copy of this operator including schema, schema set, and requiredCol.

Returns

LangSwitch

Overrides

PlanTupleOperator.clone


getChildren()

getChildren(): PlanOperator[]

Defined in: lang-sql/src/plan/langswitch.ts:53

Returns an empty array; a LangSwitch has no plan children.

Returns

PlanOperator[]

Overrides

PlanTupleOperator.getChildren


getDependencies()

getDependencies(): IdSet

Defined in: core/dist/plan/visitor.d.ts:54

PlanOperator.getDependencies

Returns

IdSet

Inherited from

PlanTupleOperator.getDependencies


removeFromSchema()

removeFromSchema(item): boolean

Defined in: core/dist/plan/visitor.d.ts:48

will preserve object references

Parameters

ParameterType
itemASTIdentifier | ASTIdentifier[] | IdSet

Returns

boolean

Inherited from

PlanTupleOperator.removeFromSchema


replaceChild()

replaceChild(current, replacement): void

Defined in: lang-sql/src/plan/langswitch.ts:46

Not supported - a LangSwitch has no plan children.

Parameters

ParameterType
currentPlanTupleOperator
replacementPlanTupleOperator

Returns

void

Throws

Always throws; replace the operator itself rather than its children.

Overrides

PlanTupleOperator.replaceChild