Parse a mutually recursive CTE (`alias ( col1: typ1, col2: typ2, ... ) AS (subquery)`). The main distinction from `parse_cte` is that the column names and types are mandatory. This is not how SQL works for `WITH RECURSIVE`, but we are doing it for now to make the query interpretation that much easier.
(&mut self)
| 7701 | /// This is not how SQL works for `WITH RECURSIVE`, but we are doing it for now to make the |
| 7702 | /// query interpretation that much easier. |
| 7703 | fn parse_cte_mut_rec(&mut self) -> Result<CteMutRec<Raw>, ParserError> { |
| 7704 | let name = self.parse_identifier()?; |
| 7705 | self.expect_token(&Token::LParen)?; |
| 7706 | let columns = self.parse_comma_separated(|parser| { |
| 7707 | Ok(CteMutRecColumnDef { |
| 7708 | name: parser.parse_identifier()?, |
| 7709 | data_type: parser.parse_data_type()?, |
| 7710 | }) |
| 7711 | })?; |
| 7712 | self.expect_token(&Token::RParen)?; |
| 7713 | self.expect_keyword(AS)?; |
| 7714 | self.expect_token(&Token::LParen)?; |
| 7715 | let query = self.parse_query()?; |
| 7716 | self.expect_token(&Token::RParen)?; |
| 7717 | Ok(CteMutRec { |
| 7718 | name, |
| 7719 | columns, |
| 7720 | query, |
| 7721 | id: (), |
| 7722 | }) |
| 7723 | } |
| 7724 | |
| 7725 | /// Parse a "query body", which is an expression with roughly the |
| 7726 | /// following grammar: |
nothing calls this directly
no test coverage detected