@@ -4263,6 +4263,14 @@ pub enum Statement {
42634263 /// ```
42644264 /// [Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_VACUUM_command.html)
42654265 Vacuum ( VacuumStatement ) ,
4266+ /// Restore the value of a run-time parameter to the default value.
4267+ ///
4268+ /// ```sql
4269+ /// RESET configuration_parameter;
4270+ /// RESET ALL;
4271+ /// ```
4272+ /// [PostgreSQL](https://www.postgresql.org/docs/current/sql-reset.html)
4273+ Reset ( ResetStatement ) ,
42664274}
42674275
42684276impl From < Analyze > for Statement {
@@ -5757,6 +5765,7 @@ impl fmt::Display for Statement {
57575765 Statement :: AlterSchema ( s) => write ! ( f, "{s}" ) ,
57585766 Statement :: Vacuum ( s) => write ! ( f, "{s}" ) ,
57595767 Statement :: AlterUser ( s) => write ! ( f, "{s}" ) ,
5768+ Statement :: Reset ( s) => write ! ( f, "{s}" ) ,
57605769 }
57615770 }
57625771}
@@ -10519,6 +10528,38 @@ impl fmt::Display for VacuumStatement {
1051910528 }
1052010529}
1052110530
10531+ /// Variants of the RESET statement
10532+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
10533+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
10534+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
10535+ pub enum Reset {
10536+ /// Resets all session parameters to their default values.
10537+ ALL ,
10538+
10539+ /// Resets a specific session parameter to its default value.
10540+ ConfigurationParameter ( ObjectName ) ,
10541+ }
10542+
10543+ /// Resets a session parameter to its default value.
10544+ /// ```sql
10545+ /// RESET { ALL | <configuration_parameter> }
10546+ /// ```
10547+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
10548+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
10549+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
10550+ pub struct ResetStatement {
10551+ pub reset : Reset ,
10552+ }
10553+
10554+ impl fmt:: Display for ResetStatement {
10555+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
10556+ match & self . reset {
10557+ Reset :: ALL => write ! ( f, "RESET ALL" ) ,
10558+ Reset :: ConfigurationParameter ( param) => write ! ( f, "RESET {}" , param) ,
10559+ }
10560+ }
10561+ }
10562+
1052210563impl From < Set > for Statement {
1052310564 fn from ( s : Set ) -> Self {
1052410565 Self :: Set ( s)
@@ -10759,6 +10800,12 @@ impl From<VacuumStatement> for Statement {
1075910800 }
1076010801}
1076110802
10803+ impl From < ResetStatement > for Statement {
10804+ fn from ( r : ResetStatement ) -> Self {
10805+ Self :: Reset ( r)
10806+ }
10807+ }
10808+
1076210809#[ cfg( test) ]
1076310810mod tests {
1076410811 use crate :: tokenizer:: Location ;
0 commit comments