LucaCappelletti94 commented on code in PR #2094:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2094#discussion_r2517727862
##########
src/parser/mod.rs:
##########
@@ -17387,6 +17425,254 @@ impl<'a> Parser<'a> {
})
}
+ /// Parse remainder of `CREATE TYPE AS RANGE` statement
+ ///
+ /// See
[PostgreSQL](https://www.postgresql.org/docs/current/sql-createtype.html)
+ pub fn parse_create_type_range(&mut self, name: ObjectName) ->
Result<Statement, ParserError> {
+ self.expect_token(&Token::LParen)?;
+ let options = self.parse_comma_separated0(|p| p.parse_range_option(),
Token::RParen)?;
+ self.expect_token(&Token::RParen)?;
+
+ Ok(Statement::CreateType {
+ name,
+ representation: UserDefinedTypeRepresentation::Range { options },
+ })
+ }
+
+ /// Parse a single range option for CREATE TYPE AS RANGE
+ fn parse_range_option(&mut self) -> Result<UserDefinedTypeRangeOption,
ParserError> {
+ let keyword = self.parse_one_of_keywords(&[
+ Keyword::SUBTYPE,
+ Keyword::SUBTYPE_OPCLASS,
Review Comment:
Oke
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]