mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-07 12:40:22 +00:00
Add support for several Snowflake grant statements (#1922)
This commit is contained in:
parent
cf9e50474e
commit
f2fba48a7a
3 changed files with 118 additions and 0 deletions
|
@ -13901,6 +13901,35 @@ impl<'a> Parser<'a> {
|
|||
Some(GrantObjects::AllTablesInSchema {
|
||||
schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
|
||||
})
|
||||
} else if self.parse_keywords(&[
|
||||
Keyword::ALL,
|
||||
Keyword::EXTERNAL,
|
||||
Keyword::TABLES,
|
||||
Keyword::IN,
|
||||
Keyword::SCHEMA,
|
||||
]) {
|
||||
Some(GrantObjects::AllExternalTablesInSchema {
|
||||
schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
|
||||
})
|
||||
} else if self.parse_keywords(&[
|
||||
Keyword::ALL,
|
||||
Keyword::VIEWS,
|
||||
Keyword::IN,
|
||||
Keyword::SCHEMA,
|
||||
]) {
|
||||
Some(GrantObjects::AllViewsInSchema {
|
||||
schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
|
||||
})
|
||||
} else if self.parse_keywords(&[
|
||||
Keyword::ALL,
|
||||
Keyword::MATERIALIZED,
|
||||
Keyword::VIEWS,
|
||||
Keyword::IN,
|
||||
Keyword::SCHEMA,
|
||||
]) {
|
||||
Some(GrantObjects::AllMaterializedViewsInSchema {
|
||||
schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
|
||||
})
|
||||
} else if self.parse_keywords(&[
|
||||
Keyword::FUTURE,
|
||||
Keyword::SCHEMAS,
|
||||
|
@ -13919,6 +13948,16 @@ impl<'a> Parser<'a> {
|
|||
Some(GrantObjects::FutureTablesInSchema {
|
||||
schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
|
||||
})
|
||||
} else if self.parse_keywords(&[
|
||||
Keyword::FUTURE,
|
||||
Keyword::EXTERNAL,
|
||||
Keyword::TABLES,
|
||||
Keyword::IN,
|
||||
Keyword::SCHEMA,
|
||||
]) {
|
||||
Some(GrantObjects::FutureExternalTablesInSchema {
|
||||
schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
|
||||
})
|
||||
} else if self.parse_keywords(&[
|
||||
Keyword::FUTURE,
|
||||
Keyword::VIEWS,
|
||||
|
@ -13928,6 +13967,16 @@ impl<'a> Parser<'a> {
|
|||
Some(GrantObjects::FutureViewsInSchema {
|
||||
schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
|
||||
})
|
||||
} else if self.parse_keywords(&[
|
||||
Keyword::FUTURE,
|
||||
Keyword::MATERIALIZED,
|
||||
Keyword::VIEWS,
|
||||
Keyword::IN,
|
||||
Keyword::SCHEMA,
|
||||
]) {
|
||||
Some(GrantObjects::FutureMaterializedViewsInSchema {
|
||||
schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
|
||||
})
|
||||
} else if self.parse_keywords(&[
|
||||
Keyword::ALL,
|
||||
Keyword::SEQUENCES,
|
||||
|
@ -13937,6 +13986,15 @@ impl<'a> Parser<'a> {
|
|||
Some(GrantObjects::AllSequencesInSchema {
|
||||
schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
|
||||
})
|
||||
} else if self.parse_keywords(&[
|
||||
Keyword::FUTURE,
|
||||
Keyword::SEQUENCES,
|
||||
Keyword::IN,
|
||||
Keyword::SCHEMA,
|
||||
]) {
|
||||
Some(GrantObjects::FutureSequencesInSchema {
|
||||
schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
|
||||
})
|
||||
} else if self.parse_keywords(&[Keyword::RESOURCE, Keyword::MONITOR]) {
|
||||
Some(GrantObjects::ResourceMonitors(self.parse_comma_separated(
|
||||
|p| p.parse_object_name_with_wildcards(false, true),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue