mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-30 14:56:57 +00:00
Add "DROP TYPE" support. (#1461)
This commit is contained in:
parent
7905fb4905
commit
c01e054fd8
3 changed files with 59 additions and 1 deletions
|
|
@ -5736,6 +5736,7 @@ pub enum ObjectType {
|
|||
Role,
|
||||
Sequence,
|
||||
Stage,
|
||||
Type,
|
||||
}
|
||||
|
||||
impl fmt::Display for ObjectType {
|
||||
|
|
@ -5749,6 +5750,7 @@ impl fmt::Display for ObjectType {
|
|||
ObjectType::Role => "ROLE",
|
||||
ObjectType::Sequence => "SEQUENCE",
|
||||
ObjectType::Stage => "STAGE",
|
||||
ObjectType::Type => "TYPE",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4889,6 +4889,8 @@ impl<'a> Parser<'a> {
|
|||
ObjectType::Sequence
|
||||
} else if self.parse_keyword(Keyword::STAGE) {
|
||||
ObjectType::Stage
|
||||
} else if self.parse_keyword(Keyword::TYPE) {
|
||||
ObjectType::Type
|
||||
} else if self.parse_keyword(Keyword::FUNCTION) {
|
||||
return self.parse_drop_function();
|
||||
} else if self.parse_keyword(Keyword::POLICY) {
|
||||
|
|
@ -4901,7 +4903,7 @@ impl<'a> Parser<'a> {
|
|||
return self.parse_drop_trigger();
|
||||
} else {
|
||||
return self.expected(
|
||||
"TABLE, VIEW, INDEX, ROLE, SCHEMA, DATABASE, FUNCTION, PROCEDURE, STAGE, TRIGGER, SECRET or SEQUENCE after DROP",
|
||||
"TABLE, VIEW, INDEX, ROLE, SCHEMA, DATABASE, FUNCTION, PROCEDURE, STAGE, TRIGGER, SECRET, SEQUENCE, or TYPE after DROP",
|
||||
self.peek_token(),
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue