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

Method parse_create_cluster

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

Source from the content-addressed store, hash-verified

4519 }
4520
4521 fn parse_create_cluster(&mut self) -> Result<Statement<Raw>, ParserError> {
4522 let name = self.parse_identifier()?;
4523 // For historical reasons, the parentheses around the options can be
4524 // omitted.
4525 let paren = self.consume_token(&Token::LParen);
4526 let options = self.parse_comma_separated(Parser::parse_cluster_option)?;
4527 if paren {
4528 self.expect_token(&Token::RParen)?;
4529 }
4530
4531 let features = if self.parse_keywords(&[FEATURES]) {
4532 self.expect_token(&Token::LParen)?;
4533 let features = self.parse_comma_separated(Parser::parse_cluster_feature)?;
4534 self.expect_token(&Token::RParen)?;
4535 features
4536 } else {
4537 Vec::new()
4538 };
4539
4540 Ok(Statement::CreateCluster(CreateClusterStatement {
4541 name,
4542 options,
4543 features,
4544 }))
4545 }
4546
4547 fn parse_cluster_option_name(&mut self) -> Result<ClusterOptionName, ParserError> {
4548 let option = self.expect_one_of_keywords(&[

Callers 1

parse_createMethod · 0.80

Calls 6

CreateClusterClass · 0.85
parse_identifierMethod · 0.80
consume_tokenMethod · 0.80
parse_comma_separatedMethod · 0.80
expect_tokenMethod · 0.80
parse_keywordsMethod · 0.80

Tested by

no test coverage detected