@@ -3321,6 +3321,14 @@ pub enum Statement {
3321
3321
drop_behavior : Option < DropBehavior > ,
3322
3322
} ,
3323
3323
/// ```sql
3324
+ /// DROP DOMAIN
3325
+ /// ```
3326
+ /// See [PostgreSQL](https://www.postgresql.org/docs/current/sql-dropdomain.html)
3327
+ ///
3328
+ /// DROP DOMAIN [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
3329
+ ///
3330
+ DropDomain ( DropDomain ) ,
3331
+ /// ```sql
3324
3332
/// DROP PROCEDURE
3325
3333
/// ```
3326
3334
DropProcedure {
@@ -5094,6 +5102,21 @@ impl fmt::Display for Statement {
5094
5102
}
5095
5103
Ok ( ( ) )
5096
5104
}
5105
+ Statement :: DropDomain ( DropDomain {
5106
+ if_exists,
5107
+ name,
5108
+ drop_behavior,
5109
+ } ) => {
5110
+ write ! (
5111
+ f,
5112
+ "DROP DOMAIN{} {name}" ,
5113
+ if * if_exists { " IF EXISTS" } else { "" } ,
5114
+ ) ?;
5115
+ if let Some ( op) = drop_behavior {
5116
+ write ! ( f, " {op}" ) ?;
5117
+ }
5118
+ Ok ( ( ) )
5119
+ }
5097
5120
Statement :: DropProcedure {
5098
5121
if_exists,
5099
5122
proc_desc,
@@ -6829,6 +6852,19 @@ impl fmt::Display for CloseCursor {
6829
6852
}
6830
6853
}
6831
6854
6855
+ /// A Drop Domain statement
6856
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
6857
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
6858
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
6859
+ pub struct DropDomain {
6860
+ /// Whether to drop the domain if it exists
6861
+ pub if_exists : bool ,
6862
+ /// The name of the domain to drop
6863
+ pub name : ObjectName ,
6864
+ /// The behavior to apply when dropping the domain
6865
+ pub drop_behavior : Option < DropBehavior > ,
6866
+ }
6867
+
6832
6868
/// A function call
6833
6869
#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
6834
6870
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
0 commit comments