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

Method parse_create_sink_option_name

src/sql-parser/src/parser.rs:3600–3615  ·  view source on GitHub ↗

Parse the name of a CREATE SINK optional parameter

(&mut self)

Source from the content-addressed store, hash-verified

3598
3599 /// Parse the name of a CREATE SINK optional parameter
3600 fn parse_create_sink_option_name(&mut self) -> Result<CreateSinkOptionName, ParserError> {
3601 let name = match self.expect_one_of_keywords(&[PARTITION, SNAPSHOT, VERSION, COMMIT])? {
3602 SNAPSHOT => CreateSinkOptionName::Snapshot,
3603 VERSION => CreateSinkOptionName::Version,
3604 PARTITION => {
3605 self.expect_keyword(STRATEGY)?;
3606 CreateSinkOptionName::PartitionStrategy
3607 }
3608 COMMIT => {
3609 self.expect_keyword(INTERVAL)?;
3610 CreateSinkOptionName::CommitInterval
3611 }
3612 _ => unreachable!(),
3613 };
3614 Ok(name)
3615 }
3616
3617 /// Parse a NAME = VALUE parameter for CREATE SINK
3618 fn parse_create_sink_option(&mut self) -> Result<CreateSinkOption<Raw>, ParserError> {

Callers 1

Calls 2

expect_keywordMethod · 0.80

Tested by

no test coverage detected