(&mut self)
| 3074 | } |
| 3075 | |
| 3076 | fn parse_create_subsource(&mut self) -> Result<Statement<Raw>, ParserError> { |
| 3077 | self.expect_keyword(SUBSOURCE)?; |
| 3078 | let if_not_exists = self.parse_if_not_exists()?; |
| 3079 | let name = self.parse_item_name()?; |
| 3080 | |
| 3081 | let (columns, constraints) = self.parse_columns(Mandatory)?; |
| 3082 | |
| 3083 | let of_source = if self.parse_keyword(OF) { |
| 3084 | self.expect_keyword(SOURCE)?; |
| 3085 | Some(self.parse_raw_name()?) |
| 3086 | } else { |
| 3087 | None |
| 3088 | }; |
| 3089 | |
| 3090 | let with_options = if self.parse_keyword(WITH) { |
| 3091 | self.expect_token(&Token::LParen)?; |
| 3092 | let options = self.parse_comma_separated(Parser::parse_create_subsource_option)?; |
| 3093 | self.expect_token(&Token::RParen)?; |
| 3094 | options |
| 3095 | } else { |
| 3096 | vec![] |
| 3097 | }; |
| 3098 | |
| 3099 | Ok(Statement::CreateSubsource(CreateSubsourceStatement { |
| 3100 | name, |
| 3101 | if_not_exists, |
| 3102 | columns, |
| 3103 | of_source, |
| 3104 | constraints, |
| 3105 | with_options, |
| 3106 | })) |
| 3107 | } |
| 3108 | |
| 3109 | fn parse_create_subsource_option(&mut self) -> Result<CreateSubsourceOption<Raw>, ParserError> { |
| 3110 | let option = match self |
no test coverage detected