isJoinKeyword checks if current token is a JOIN-related keyword
()
| 1101 | |
| 1102 | // isJoinKeyword checks if current token is a JOIN-related keyword |
| 1103 | func (p *Parser) isJoinKeyword() bool { |
| 1104 | if p.isAnyType( |
| 1105 | models.TokenTypeJoin, models.TokenTypeInner, models.TokenTypeLeft, |
| 1106 | models.TokenTypeRight, models.TokenTypeFull, models.TokenTypeCross, |
| 1107 | models.TokenTypeNatural, |
| 1108 | ) { |
| 1109 | return true |
| 1110 | } |
| 1111 | // SQL Server: OUTER APPLY starts with OUTER |
| 1112 | if p.dialect == string(keywords.DialectSQLServer) && p.isType(models.TokenTypeOuter) { |
| 1113 | return true |
| 1114 | } |
| 1115 | // ClickHouse: GLOBAL JOIN — GLOBAL is TokenTypeKeyword, not a dedicated join token |
| 1116 | if p.dialect == string(keywords.DialectClickHouse) && p.isTokenMatch("GLOBAL") { |
| 1117 | return true |
| 1118 | } |
| 1119 | // ClickHouse: ANY / ALL as join strictness prefix (ANY LEFT JOIN, ALL INNER JOIN) |
| 1120 | if p.dialect == string(keywords.DialectClickHouse) && |
| 1121 | (p.isType(models.TokenTypeAny) || p.isType(models.TokenTypeAll)) { |
| 1122 | return true |
| 1123 | } |
| 1124 | return false |
| 1125 | } |
| 1126 | |
| 1127 | // parseWithStatement parses a WITH statement (Common Table Expression). |
| 1128 | // It supports both simple and recursive CTEs, multiple CTE definitions, and column specifications. |
no test coverage detected