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

Method parse_alter_cluster_option

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

Source from the content-addressed store, hash-verified

4598 }
4599
4600 fn parse_alter_cluster_option(&mut self) -> Result<ClusterAlterOption<Raw>, ParserError> {
4601 let (name, value) = match self.expect_one_of_keywords(&[WAIT])? {
4602 WAIT => {
4603 let _ = self.consume_token(&Token::Eq);
4604 let v = match self.expect_one_of_keywords(&[FOR, UNTIL])? {
4605 FOR => Some(WithOptionValue::ClusterAlterStrategy(
4606 ClusterAlterOptionValue::For(self.parse_value()?),
4607 )),
4608 UNTIL => {
4609 self.expect_keyword(READY)?;
4610 let _ = self.consume_token(&Token::Eq);
4611 self.expect_token(&Token::LParen)?;
4612 let opts = Some(WithOptionValue::ClusterAlterStrategy(
4613 ClusterAlterOptionValue::UntilReady(self.parse_comma_separated(
4614 Parser::parse_cluster_alter_until_ready_option,
4615 )?),
4616 ));
4617 self.expect_token(&Token::RParen)?;
4618 opts
4619 }
4620 _ => unreachable!(),
4621 };
4622 (ClusterAlterOptionName::Wait, v)
4623 }
4624 _ => unreachable!(),
4625 };
4626 Ok(ClusterAlterOption { name, value })
4627 }
4628
4629 fn parse_cluster_alter_until_ready_option(
4630 &mut self,

Callers

nothing calls this directly

Calls 6

consume_tokenMethod · 0.80
parse_valueMethod · 0.80
expect_keywordMethod · 0.80
expect_tokenMethod · 0.80
parse_comma_separatedMethod · 0.80

Tested by

no test coverage detected