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
| Parameter | Type | Description |
|---|---|---|
lang | Lowercase<string> | - |
node | LangSwitch | The AST node containing the embedded language-switch expression. |
langCtx | Record<string, unknown> & object | Shared cross-language context; the sql entry holds the current SQLLangCtx. |
Returns
LangSwitch
Overrides
Properties
lang
lang:
Lowercase<string>
Defined in: core/dist/plan/visitor.d.ts:36
PlanOperator.lang
Inherited from
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?
optionalparent?:PlanOperator
Defined in: core/dist/plan/visitor.d.ts:38
PlanOperator.parent
Inherited from
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
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
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
| Parameter | Type |
|---|---|
visitors | Record<string, SQLPlanVisitor<Ret, Arg>> |
arg? | Arg |
Returns
Ret
Overrides
addToSchema()
addToSchema(
item):void
Defined in: core/dist/plan/visitor.d.ts:46
will preserve object references
Parameters
| Parameter | Type |
|---|---|
item | ASTIdentifier | ASTIdentifier[] | IdSet |
Returns
void
Inherited from
clearSchema()
clearSchema():
void
Defined in: core/dist/plan/visitor.d.ts:50
will preserve object references
Returns
void
Inherited from
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
getChildren()
getChildren():
PlanOperator[]
Defined in: lang-sql/src/plan/langswitch.ts:53
Returns an empty array; a LangSwitch has no plan children.
Returns
Overrides
getDependencies()
getDependencies():
IdSet
Defined in: core/dist/plan/visitor.d.ts:54
PlanOperator.getDependencies
Returns
Inherited from
PlanTupleOperator.getDependencies
removeFromSchema()
removeFromSchema(
item):boolean
Defined in: core/dist/plan/visitor.d.ts:48
will preserve object references
Parameters
| Parameter | Type |
|---|---|
item | ASTIdentifier | 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
| Parameter | Type |
|---|---|
current | PlanTupleOperator |
replacement | PlanTupleOperator |
Returns
void
Throws
Always throws; replace the operator itself rather than its children.