Class MsAbstractExprWithNmspc<T>
java.lang.Object
org.pgcodekeeper.core.database.base.parser.antlr.AbstractExpr
org.pgcodekeeper.core.database.ms.parser.expr.MsAbstractExpr
org.pgcodekeeper.core.database.ms.parser.expr.MsAbstractExprWithNmspc<T>
- Type Parameters:
T- analyzed expression, should be extension of ParserRuleContext or a rulectx wrapper class
Abstract base class for analyzing Microsoft SQL expressions with namespace support.
Provides functionality for managing table aliases, common table expressions (CTEs),
and resolving object references within a specific namespace context.
- Author:
- levsha_aa
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddRawTableReference(ObjectReference qualifiedTable) Adds an unaliased table reference to the namespace.booleanaddReference(String alias, ObjectReference object) Adds a reference to the namespace with the specified alias.Analyzes the given rule context and returns a list of column names.findReference(String schema, String name, String column) Methods inherited from class org.pgcodekeeper.core.database.base.parser.antlr.AbstractExpr
addDependency, addDependency, addDependency, addReference, addVariable, getDependencies
-
Method Details
-
findReference
- Overrides:
findReferencein classAbstractExpr- Parameters:
schema- optional schema qualification of name, may be nullname- alias of the referenced objectcolumn- optional referenced column alias, may be null- Returns:
- a pair of (Alias, Dealiased name) where Alias is the given name.
Dealiased name can be null if the name is internal to the query
and is not a reference to external table.
null if the name is not found
-
addReference
Adds a reference to the namespace with the specified alias. Clients may use this to setup pseudo-variable names before expression analysis.- Parameters:
alias- the alias name for the referenceobject- the database object being referenced, may be null for internal query names- Returns:
- true if the reference was added successfully, false if alias already exists
-
addRawTableReference
Adds an unaliased table reference to the namespace. Used for tables that don't have explicit aliases in the FROM clause.- Parameters:
qualifiedTable- the fully qualified table reference to add
-
analyze
Analyzes the given rule context and returns a list of column names. Implementations should process the specific Microsoft SQL expression type and extract relevant database dependencies and column information.- Parameters:
ruleCtx- the parser rule context to analyze- Returns:
- list of column names found during analysis
-