parseSnowflakeUseStatement parses: USE [WAREHOUSE | DATABASE | SCHEMA | ROLE] The object-kind keyword is optional (plain "USE " switches the current database). We parse-only; the statement is represented as a DescribeStatement placeholder until a dedicated UseStatement node is introd
()
| 752 | // database). We parse-only; the statement is represented as a DescribeStatement |
| 753 | // placeholder until a dedicated UseStatement node is introduced. |
| 754 | func (p *Parser) parseSnowflakeUseStatement() (ast.Statement, error) { |
| 755 | p.advance() // Consume USE |
| 756 | // Optional object kind. |
| 757 | switch strings.ToUpper(p.currentToken.Token.Value) { |
| 758 | case "WAREHOUSE", "DATABASE", "SCHEMA", "ROLE": |
| 759 | p.advance() |
| 760 | } |
| 761 | name, err := p.parseQualifiedName() |
| 762 | if err != nil { |
| 763 | return nil, p.expectedError("name after USE") |
| 764 | } |
| 765 | stmt := ast.GetDescribeStatement() |
| 766 | stmt.TableName = "USE " + name |
| 767 | return stmt, nil |
| 768 | } |
| 769 | |
| 770 | // parseSnowflakeStageStatement parses Snowflake stage operations as stubs: |
| 771 | // |
no test coverage detected