@@ -2821,7 +2821,7 @@ impl fmt::Display for Declare {
28212821}
28222822
28232823/// Sql options of a `CREATE TABLE` statement.
2824- #[ derive( Default , Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
2824+ #[ derive( Default , Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash , Default ) ]
28252825#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
28262826#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
28272827pub enum CreateTableOptions {
@@ -4292,6 +4292,14 @@ pub enum Statement {
42924292 /// ```
42934293 /// [Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_VACUUM_command.html)
42944294 Vacuum ( VacuumStatement ) ,
4295+ /// Restore the value of a run-time parameter to the default value.
4296+ ///
4297+ /// ```sql
4298+ /// RESET configuration_parameter;
4299+ /// RESET ALL;
4300+ /// ```
4301+ /// [PostgreSQL](https://www.postgresql.org/docs/current/sql-reset.html)
4302+ Reset ( ResetStatement ) ,
42954303}
42964304
42974305impl From < Analyze > for Statement {
@@ -5786,6 +5794,7 @@ impl fmt::Display for Statement {
57865794 Statement :: AlterSchema ( s) => write ! ( f, "{s}" ) ,
57875795 Statement :: Vacuum ( s) => write ! ( f, "{s}" ) ,
57885796 Statement :: AlterUser ( s) => write ! ( f, "{s}" ) ,
5797+ Statement :: Reset ( s) => write ! ( f, "{s}" ) ,
57895798 }
57905799 }
57915800}
@@ -10548,6 +10557,38 @@ impl fmt::Display for VacuumStatement {
1054810557 }
1054910558}
1055010559
10560+ /// Variants of the RESET statement
10561+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
10562+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
10563+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
10564+ pub enum Reset {
10565+ /// Resets all session parameters to their default values.
10566+ ALL ,
10567+
10568+ /// Resets a specific session parameter to its default value.
10569+ ConfigurationParameter ( ObjectName ) ,
10570+ }
10571+
10572+ /// Resets a session parameter to its default value.
10573+ /// ```sql
10574+ /// RESET { ALL | <configuration_parameter> }
10575+ /// ```
10576+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
10577+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
10578+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
10579+ pub struct ResetStatement {
10580+ pub reset : Reset ,
10581+ }
10582+
10583+ impl fmt:: Display for ResetStatement {
10584+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
10585+ match & self . reset {
10586+ Reset :: ALL => write ! ( f, "RESET ALL" ) ,
10587+ Reset :: ConfigurationParameter ( param) => write ! ( f, "RESET {}" , param) ,
10588+ }
10589+ }
10590+ }
10591+
1055110592impl From < Set > for Statement {
1055210593 fn from ( s : Set ) -> Self {
1055310594 Self :: Set ( s)
@@ -10788,6 +10829,12 @@ impl From<VacuumStatement> for Statement {
1078810829 }
1078910830}
1079010831
10832+ impl From < ResetStatement > for Statement {
10833+ fn from ( r : ResetStatement ) -> Self {
10834+ Self :: Reset ( r)
10835+ }
10836+ }
10837+
1079110838#[ cfg( test) ]
1079210839mod tests {
1079310840 use crate :: tokenizer:: Location ;
0 commit comments