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

Method parse_subscribe_output

src/sql-parser/src/parser.rs:8926–8946  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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.

Callers 1

parse_subscribeMethod · 0.80

Calls 6

parse_keywordsMethod · 0.80
expect_tokenMethod · 0.80
expect_keywordMethod · 0.80
parse_comma_separatedMethod · 0.80

Tested by

no test coverage detected