MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_cte

Method parse_cte

src/sql-parser/src/parser.rs:7681–7696  ·  view source on GitHub ↗

Parse a CTE (`alias [( col1, col2, ... )] AS (subquery)`)

(&mut self)

Source from the content-addressed store, hash-verified

7679
7680 /// Parse a CTE (`alias [( col1, col2, ... )] AS (subquery)`)
7681 fn parse_cte(&mut self) -> Result<Cte<Raw>, ParserError> {
7682 let alias = TableAlias {
7683 name: self.parse_identifier()?,
7684 columns: self.parse_parenthesized_column_list(Optional)?,
7685 strict: false,
7686 };
7687 self.expect_keyword(AS)?;
7688 self.expect_token(&Token::LParen)?;
7689 let query = self.parse_query()?;
7690 self.expect_token(&Token::RParen)?;
7691 Ok(Cte {
7692 alias,
7693 query,
7694 id: (),
7695 })
7696 }
7697
7698 /// Parse a mutually recursive CTE (`alias ( col1: typ1, col2: typ2, ... ) AS (subquery)`).
7699 ///

Callers

nothing calls this directly

Calls 5

parse_identifierMethod · 0.80
expect_keywordMethod · 0.80
expect_tokenMethod · 0.80
parse_queryMethod · 0.45

Tested by

no test coverage detected