MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / canBeAlias

Method canBeAlias

pkg/sql/parser/parser.go:1087–1092  ·  view source on GitHub ↗

canBeAlias checks if current token can be used as an alias. Aliases can be IDENT, double-quoted identifiers, or certain non-reserved keywords, but NOT contextual clause keywords that would be consumed as aliases by mistake (e.g. MINUS in Snowflake/Oracle, QUALIFY in Snowflake/BigQuery).

()

Source from the content-addressed store, hash-verified

1085// but NOT contextual clause keywords that would be consumed as aliases by mistake
1086// (e.g. MINUS in Snowflake/Oracle, QUALIFY in Snowflake/BigQuery).
1087func (p *Parser) canBeAlias() bool {
1088 if p.isMinusSetOp() || p.isQualifyKeyword() {
1089 return false
1090 }
1091 return p.isIdentifier() || p.isNonReservedKeyword()
1092}
1093
1094// parseAlterTableStmt is a simplified version for the parser implementation
1095// It delegates to the more comprehensive parseAlterStatement in alter.go

Callers 3

parseMergeStatementMethod · 0.95
parseMergeActionMethod · 0.95
parseSelectColumnListMethod · 0.95

Calls 4

isMinusSetOpMethod · 0.95
isQualifyKeywordMethod · 0.95
isIdentifierMethod · 0.95
isNonReservedKeywordMethod · 0.95

Tested by

no test coverage detected