@@ -3321,6 +3321,14 @@ pub enum Statement {
33213321 drop_behavior : Option < DropBehavior > ,
33223322 } ,
33233323 /// ```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
33243332 /// DROP PROCEDURE
33253333 /// ```
33263334 DropProcedure {
@@ -5094,6 +5102,21 @@ impl fmt::Display for Statement {
50945102 }
50955103 Ok ( ( ) )
50965104 }
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+ }
50975120 Statement :: DropProcedure {
50985121 if_exists,
50995122 proc_desc,
@@ -6829,6 +6852,19 @@ impl fmt::Display for CloseCursor {
68296852 }
68306853}
68316854
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+
68326868/// A function call
68336869#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
68346870#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
0 commit comments