File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -6920,6 +6920,8 @@ pub enum GrantObjects {
6920
6920
AllSequencesInSchema { schemas : Vec < ObjectName > } ,
6921
6921
/// Grant privileges on `ALL TABLES IN SCHEMA <schema_name> [, ...]`
6922
6922
AllTablesInSchema { schemas : Vec < ObjectName > } ,
6923
+ /// Grant privileges on `ALL VIEWS IN SCHEMA <schema_name> [, ...]`
6924
+ AllViewsInSchema { schemas : Vec < ObjectName > } ,
6923
6925
/// Grant privileges on `FUTURE SCHEMAS IN DATABASE <database_name> [, ...]`
6924
6926
FutureSchemasInDatabase { databases : Vec < ObjectName > } ,
6925
6927
/// Grant privileges on `FUTURE TABLES IN SCHEMA <schema_name> [, ...]`
@@ -6994,6 +6996,13 @@ impl fmt::Display for GrantObjects {
6994
6996
display_comma_separated( schemas)
6995
6997
)
6996
6998
}
6999
+ GrantObjects :: AllViewsInSchema { schemas } => {
7000
+ write ! (
7001
+ f,
7002
+ "ALL VIEWS IN SCHEMA {}" ,
7003
+ display_comma_separated( schemas)
7004
+ )
7005
+ }
6997
7006
GrantObjects :: FutureSchemasInDatabase { databases } => {
6998
7007
write ! (
6999
7008
f,
Original file line number Diff line number Diff line change @@ -13866,6 +13866,15 @@ impl<'a> Parser<'a> {
13866
13866
Some(GrantObjects::AllTablesInSchema {
13867
13867
schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
13868
13868
})
13869
+ } else if self.parse_keywords(&[
13870
+ Keyword::ALL,
13871
+ Keyword::VIEWS,
13872
+ Keyword::IN,
13873
+ Keyword::SCHEMA,
13874
+ ]) {
13875
+ Some(GrantObjects::AllViewsInSchema {
13876
+ schemas: self.parse_comma_separated(|p| p.parse_object_name(false))?,
13877
+ })
13869
13878
} else if self.parse_keywords(&[
13870
13879
Keyword::FUTURE,
13871
13880
Keyword::SCHEMAS,
Original file line number Diff line number Diff line change @@ -9376,6 +9376,7 @@ fn parse_grant() {
9376
9376
verified_stmt("GRANT SELECT ON ALL TABLES IN SCHEMA db1.sc1 TO APPLICATION role1");
9377
9377
verified_stmt("GRANT SELECT ON ALL TABLES IN SCHEMA db1.sc1 TO APPLICATION ROLE role1");
9378
9378
verified_stmt("GRANT SELECT ON ALL TABLES IN SCHEMA db1.sc1 TO SHARE share1");
9379
+ verified_stmt("GRANT SELECT ON ALL VIEWS IN SCHEMA db1.sc1 TO ROLE role1");
9379
9380
verified_stmt("GRANT USAGE ON SCHEMA sc1 TO a:b");
9380
9381
verified_stmt("GRANT USAGE ON SCHEMA sc1 TO GROUP group1");
9381
9382
verified_stmt("GRANT OWNERSHIP ON ALL TABLES IN SCHEMA DEV_STAS_ROGOZHIN TO ROLE ANALYST");
You can’t perform that action at this time.
0 commit comments