(&mut self)
| 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. |
no test coverage detected