(&mut self)
| 8924 | } |
| 8925 | |
| 8926 | fn parse_subscribe_output(&mut self) -> Result<SubscribeOutput<Raw>, ParserError> { |
| 8927 | if self.parse_keywords(&[ENVELOPE]) { |
| 8928 | let keyword = self.expect_one_of_keywords(&[UPSERT, DEBEZIUM])?; |
| 8929 | self.expect_token(&Token::LParen)?; |
| 8930 | self.expect_keyword(KEY)?; |
| 8931 | let key_columns = self.parse_parenthesized_column_list(Mandatory)?; |
| 8932 | let output = match keyword { |
| 8933 | UPSERT => SubscribeOutput::EnvelopeUpsert { key_columns }, |
| 8934 | DEBEZIUM => SubscribeOutput::EnvelopeDebezium { key_columns }, |
| 8935 | _ => unreachable!("no other keyword allowed"), |
| 8936 | }; |
| 8937 | self.expect_token(&Token::RParen)?; |
| 8938 | Ok(output) |
| 8939 | } else if self.parse_keywords(&[WITHIN, TIMESTAMP, ORDER, BY]) { |
| 8940 | Ok(SubscribeOutput::WithinTimestampOrderBy { |
| 8941 | order_by: self.parse_comma_separated(Parser::parse_order_by_expr)?, |
| 8942 | }) |
| 8943 | } else { |
| 8944 | Ok(SubscribeOutput::Diffs) |
| 8945 | } |
| 8946 | } |
| 8947 | |
| 8948 | /// Parse an `EXPLAIN` statement, assuming that the `EXPLAIN` token |
| 8949 | /// has already been consumed. |
no test coverage detected