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

Method parse_create_view

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

Source from the content-addressed store, hash-verified

4056 }
4057
4058 fn parse_create_view(&mut self) -> Result<Statement<Raw>, ParserError> {
4059 let mut if_exists = if self.parse_keyword(OR) {
4060 self.expect_keyword(REPLACE)?;
4061 IfExistsBehavior::Replace
4062 } else {
4063 IfExistsBehavior::Error
4064 };
4065 let temporary = self.parse_keyword(TEMPORARY) | self.parse_keyword(TEMP);
4066 self.expect_keyword(VIEW)?;
4067 if if_exists == IfExistsBehavior::Error && self.parse_if_not_exists()? {
4068 if_exists = IfExistsBehavior::Skip;
4069 }
4070
4071 let definition = self.parse_view_definition()?;
4072 Ok(Statement::CreateView(CreateViewStatement {
4073 temporary,
4074 if_exists,
4075 definition,
4076 }))
4077 }
4078
4079 fn parse_view_definition(&mut self) -> Result<ViewDefinition<Raw>, ParserError> {
4080 // ANSI SQL and Postgres support RECURSIVE here, but we don't.

Callers 2

parse_createMethod · 0.80
parse_explaineeMethod · 0.80

Calls 5

CreateViewClass · 0.85
parse_keywordMethod · 0.80
expect_keywordMethod · 0.80
parse_if_not_existsMethod · 0.80
parse_view_definitionMethod · 0.80

Tested by

no test coverage detected