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

Method parse_alter_connection_action

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

Source from the content-addressed store, hash-verified

6336 }
6337
6338 fn parse_alter_connection_action(&mut self) -> Result<AlterConnectionAction<Raw>, ParserError> {
6339 let r = match self.expect_one_of_keywords(&[ROTATE, SET, RESET, DROP])? {
6340 ROTATE => {
6341 self.expect_keyword(KEYS)?;
6342 AlterConnectionAction::RotateKeys
6343 }
6344 SET => {
6345 self.expect_token(&Token::LParen)?;
6346 let option = self.parse_connection_option_unified()?;
6347 self.expect_token(&Token::RParen)?;
6348 AlterConnectionAction::SetOption(option)
6349 }
6350 DROP | RESET => {
6351 self.expect_token(&Token::LParen)?;
6352 let option = self.parse_connection_option_name()?;
6353 self.expect_token(&Token::RParen)?;
6354 AlterConnectionAction::DropOption(option)
6355 }
6356 _ => unreachable!(),
6357 };
6358
6359 Ok(r)
6360 }
6361
6362 /// Parses a single valid option in the WITH block of a create source
6363 fn parse_alter_connection_option(&mut self) -> Result<AlterConnectionOption<Raw>, ParserError> {

Callers

nothing calls this directly

Calls 5

expect_keywordMethod · 0.80
expect_tokenMethod · 0.80

Tested by

no test coverage detected