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

Method parse_table_option_name

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

Source from the content-addressed store, hash-verified

4305 }
4306
4307 fn parse_table_option_name(&mut self) -> Result<TableOptionName, ParserError> {
4308 // this is only so we can test redacted values, of which no other
4309 // examples exist as of its introduction.
4310 if self.parse_keyword(REDACTED) {
4311 return Ok(TableOptionName::RedactedTest);
4312 }
4313 let name = match self.expect_one_of_keywords(&[PARTITION, RETAIN])? {
4314 PARTITION => {
4315 self.expect_keyword(BY)?;
4316 TableOptionName::PartitionBy
4317 }
4318 RETAIN => {
4319 self.expect_keyword(HISTORY)?;
4320 TableOptionName::RetainHistory
4321 }
4322 _ => unreachable!(),
4323 };
4324 Ok(name)
4325 }
4326
4327 fn parse_table_option(&mut self) -> Result<TableOption<Raw>, ParserError> {
4328 let name = self.parse_table_option_name()?;

Callers 1

parse_table_optionMethod · 0.80

Calls 3

parse_keywordMethod · 0.80
expect_keywordMethod · 0.80

Tested by

no test coverage detected