@@ -33,13 +33,13 @@ use crate::ast::{
3333 display_comma_separated, display_separated, ArgMode , AttachedToken , CommentDef ,
3434 ConditionalStatements , CreateFunctionBody , CreateFunctionUsing , CreateTableLikeKind ,
3535 CreateTableOptions , CreateViewParams , DataType , Expr , FileFormat , FunctionBehavior ,
36- FunctionCalledOnNull , FunctionDeterminismSpecifier , FunctionParallel , HiveDistributionStyle ,
37- HiveFormat , HiveIOFormat , HiveRowFormat , HiveSetLocation , Ident , InitializeKind ,
38- MySQLColumnPosition , ObjectName , OnCommit , OneOrManyWithParens , OperateFunctionArg ,
39- OrderByExpr , ProjectionSelect , Query , RefreshModeKind , RowAccessPolicy , SequenceOptions ,
40- Spanned , SqlOption , StorageSerializationPolicy , TableVersion , Tag , TriggerEvent ,
41- TriggerExecBody , TriggerObject , TriggerPeriod , TriggerReferencing , Value , ValueWithSpan ,
42- WrappedCollection ,
36+ FunctionCalledOnNull , FunctionDesc , FunctionDeterminismSpecifier , FunctionParallel ,
37+ HiveDistributionStyle , HiveFormat , HiveIOFormat , HiveRowFormat , HiveSetLocation , Ident ,
38+ InitializeKind , MySQLColumnPosition , ObjectName , OnCommit , OneOrManyWithParens ,
39+ OperateFunctionArg , OrderByExpr , ProjectionSelect , Query , RefreshModeKind , RowAccessPolicy ,
40+ SequenceOptions , Spanned , SqlOption , StorageSerializationPolicy , TableVersion , Tag ,
41+ TriggerEvent , TriggerExecBody , TriggerObject , TriggerPeriod , TriggerReferencing , Value ,
42+ ValueWithSpan , WrappedCollection ,
4343} ;
4444use crate :: display_utils:: { DisplayCommaSeparated , Indent , NewLine , SpaceOrNewline } ;
4545use crate :: keywords:: Keyword ;
@@ -3799,3 +3799,36 @@ impl fmt::Display for AlterTable {
37993799 Ok ( ( ) )
38003800 }
38013801}
3802+
3803+ /// DROP FUNCTION statement
3804+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
3805+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
3806+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
3807+ pub struct DropFunction {
3808+ pub if_exists : bool ,
3809+ /// One or more functions to drop
3810+ pub func_desc : Vec < FunctionDesc > ,
3811+ /// `CASCADE` or `RESTRICT`
3812+ pub drop_behavior : Option < DropBehavior > ,
3813+ }
3814+
3815+ impl fmt:: Display for DropFunction {
3816+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
3817+ write ! (
3818+ f,
3819+ "DROP FUNCTION{} {}" ,
3820+ if self . if_exists { " IF EXISTS" } else { "" } ,
3821+ display_comma_separated( & self . func_desc) ,
3822+ ) ?;
3823+ if let Some ( op) = & self . drop_behavior {
3824+ write ! ( f, " {op}" ) ?;
3825+ }
3826+ Ok ( ( ) )
3827+ }
3828+ }
3829+
3830+ impl Spanned for DropFunction {
3831+ fn span ( & self ) -> Span {
3832+ Span :: empty ( )
3833+ }
3834+ }
0 commit comments