@@ -3996,6 +3996,7 @@ pub enum Statement {
39963996 with_grant_option : bool ,
39973997 as_grantor : Option < Ident > ,
39983998 granted_by : Option < Ident > ,
3999+ current_grants : Option < CurrentGrantsKind > ,
39994000 } ,
40004001 /// ```sql
40014002 /// DENY privileges ON object TO grantees
@@ -4312,6 +4313,28 @@ pub enum Statement {
43124313 Return ( ReturnStatement ) ,
43134314}
43144315
4316+ /// ```sql
4317+ /// {COPY | REVOKE} CURRENT GRANTS
4318+ /// ```
4319+ ///
4320+ /// - [Snowflake](https://docs.snowflake.com/en/sql-reference/sql/grant-ownership#optional-parameters)
4321+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
4322+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
4323+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
4324+ pub enum CurrentGrantsKind {
4325+ CopyCurrentGrants ,
4326+ RevokeCurrentGrants ,
4327+ }
4328+
4329+ impl fmt:: Display for CurrentGrantsKind {
4330+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
4331+ match self {
4332+ CurrentGrantsKind :: CopyCurrentGrants => write ! ( f, "COPY CURRENT GRANTS" ) ,
4333+ CurrentGrantsKind :: RevokeCurrentGrants => write ! ( f, "REVOKE CURRENT GRANTS" ) ,
4334+ }
4335+ }
4336+ }
4337+
43154338#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
43164339#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
43174340#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
@@ -5715,6 +5738,7 @@ impl fmt::Display for Statement {
57155738 with_grant_option,
57165739 as_grantor,
57175740 granted_by,
5741+ current_grants,
57185742 } => {
57195743 write ! ( f, "GRANT {privileges} " ) ?;
57205744 if let Some ( objects) = objects {
@@ -5724,6 +5748,9 @@ impl fmt::Display for Statement {
57245748 if * with_grant_option {
57255749 write ! ( f, " WITH GRANT OPTION" ) ?;
57265750 }
5751+ if let Some ( current_grants) = current_grants {
5752+ write ! ( f, " {current_grants}" ) ?;
5753+ }
57275754 if let Some ( grantor) = as_grantor {
57285755 write ! ( f, " AS {grantor}" ) ?;
57295756 }
0 commit comments