mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-28 22:12:24 +00:00
Support DROP DATABASE (#1443)
This commit is contained in:
parent
2af981e4e6
commit
73dc8a352d
3 changed files with 42 additions and 1 deletions
|
|
@ -5691,6 +5691,7 @@ pub enum ObjectType {
|
|||
View,
|
||||
Index,
|
||||
Schema,
|
||||
Database,
|
||||
Role,
|
||||
Sequence,
|
||||
Stage,
|
||||
|
|
@ -5703,6 +5704,7 @@ impl fmt::Display for ObjectType {
|
|||
ObjectType::View => "VIEW",
|
||||
ObjectType::Index => "INDEX",
|
||||
ObjectType::Schema => "SCHEMA",
|
||||
ObjectType::Database => "DATABASE",
|
||||
ObjectType::Role => "ROLE",
|
||||
ObjectType::Sequence => "SEQUENCE",
|
||||
ObjectType::Stage => "STAGE",
|
||||
|
|
|
|||
|
|
@ -4881,6 +4881,8 @@ impl<'a> Parser<'a> {
|
|||
ObjectType::Role
|
||||
} else if self.parse_keyword(Keyword::SCHEMA) {
|
||||
ObjectType::Schema
|
||||
} else if self.parse_keyword(Keyword::DATABASE) {
|
||||
ObjectType::Database
|
||||
} else if self.parse_keyword(Keyword::SEQUENCE) {
|
||||
ObjectType::Sequence
|
||||
} else if self.parse_keyword(Keyword::STAGE) {
|
||||
|
|
@ -4897,7 +4899,7 @@ impl<'a> Parser<'a> {
|
|||
return self.parse_drop_trigger();
|
||||
} else {
|
||||
return self.expected(
|
||||
"TABLE, VIEW, INDEX, ROLE, SCHEMA, FUNCTION, PROCEDURE, STAGE, TRIGGER, SECRET or SEQUENCE after DROP",
|
||||
"TABLE, VIEW, INDEX, ROLE, SCHEMA, DATABASE, FUNCTION, PROCEDURE, STAGE, TRIGGER, SECRET or SEQUENCE after DROP",
|
||||
self.peek_token(),
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue