@@ -4025,6 +4025,7 @@ pub enum Statement {
40254025 with_grant_option : bool ,
40264026 as_grantor : Option < Ident > ,
40274027 granted_by : Option < Ident > ,
4028+ current_grants : Option < CurrentGrantsKind > ,
40284029 } ,
40294030 /// ```sql
40304031 /// DENY privileges ON object TO grantees
@@ -4341,6 +4342,28 @@ pub enum Statement {
43414342 Return ( ReturnStatement ) ,
43424343}
43434344
4345+ /// ```sql
4346+ /// {COPY | REVOKE} CURRENT GRANTS
4347+ /// ```
4348+ ///
4349+ /// - [Snowflake](https://docs.snowflake.com/en/sql-reference/sql/grant-ownership#optional-parameters)
4350+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
4351+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
4352+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
4353+ pub enum CurrentGrantsKind {
4354+ CopyCurrentGrants ,
4355+ RevokeCurrentGrants ,
4356+ }
4357+
4358+ impl fmt:: Display for CurrentGrantsKind {
4359+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
4360+ match self {
4361+ CurrentGrantsKind :: CopyCurrentGrants => write ! ( f, "COPY CURRENT GRANTS" ) ,
4362+ CurrentGrantsKind :: RevokeCurrentGrants => write ! ( f, "REVOKE CURRENT GRANTS" ) ,
4363+ }
4364+ }
4365+ }
4366+
43444367#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
43454368#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
43464369#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
@@ -5744,6 +5767,7 @@ impl fmt::Display for Statement {
57445767 with_grant_option,
57455768 as_grantor,
57465769 granted_by,
5770+ current_grants,
57475771 } => {
57485772 write ! ( f, "GRANT {privileges} " ) ?;
57495773 if let Some ( objects) = objects {
@@ -5753,6 +5777,9 @@ impl fmt::Display for Statement {
57535777 if * with_grant_option {
57545778 write ! ( f, " WITH GRANT OPTION" ) ?;
57555779 }
5780+ if let Some ( current_grants) = current_grants {
5781+ write ! ( f, " {current_grants}" ) ?;
5782+ }
57565783 if let Some ( grantor) = as_grantor {
57575784 write ! ( f, " AS {grantor}" ) ?;
57585785 }
0 commit comments