@@ -2787,10 +2787,11 @@ impl fmt::Display for Declare {
27872787}
27882788
27892789/// Sql options of a `CREATE TABLE` statement.
2790- #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
2790+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash , Default ) ]
27912791#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
27922792#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
27932793pub enum CreateTableOptions {
2794+ #[ default]
27942795 None ,
27952796 /// Options specified using the `WITH` keyword.
27962797 /// e.g. `WITH (description = "123")`
@@ -2819,12 +2820,6 @@ pub enum CreateTableOptions {
28192820 TableProperties ( Vec < SqlOption > ) ,
28202821}
28212822
2822- impl Default for CreateTableOptions {
2823- fn default ( ) -> Self {
2824- Self :: None
2825- }
2826- }
2827-
28282823impl fmt:: Display for CreateTableOptions {
28292824 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
28302825 match self {
@@ -4263,6 +4258,14 @@ pub enum Statement {
42634258 /// ```
42644259 /// [Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_VACUUM_command.html)
42654260 Vacuum ( VacuumStatement ) ,
4261+ /// Restore the value of a run-time parameter to the default value.
4262+ ///
4263+ /// ```sql
4264+ /// RESET configuration_parameter;
4265+ /// RESET ALL;
4266+ /// ```
4267+ /// [PostgreSQL](https://www.postgresql.org/docs/current/sql-reset.html)
4268+ Reset ( ResetStatement ) ,
42664269}
42674270
42684271impl From < Analyze > for Statement {
@@ -5757,6 +5760,7 @@ impl fmt::Display for Statement {
57575760 Statement :: AlterSchema ( s) => write ! ( f, "{s}" ) ,
57585761 Statement :: Vacuum ( s) => write ! ( f, "{s}" ) ,
57595762 Statement :: AlterUser ( s) => write ! ( f, "{s}" ) ,
5763+ Statement :: Reset ( s) => write ! ( f, "{s}" ) ,
57605764 }
57615765 }
57625766}
@@ -10519,6 +10523,38 @@ impl fmt::Display for VacuumStatement {
1051910523 }
1052010524}
1052110525
10526+ /// Variants of the RESET statement
10527+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
10528+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
10529+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
10530+ pub enum Reset {
10531+ /// Resets all session parameters to their default values.
10532+ ALL ,
10533+
10534+ /// Resets a specific session parameter to its default value.
10535+ ConfigurationParameter ( ObjectName ) ,
10536+ }
10537+
10538+ /// Resets a session parameter to its default value.
10539+ /// ```sql
10540+ /// RESET { ALL | <configuration_parameter> }
10541+ /// ```
10542+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
10543+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
10544+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
10545+ pub struct ResetStatement {
10546+ pub reset : Reset ,
10547+ }
10548+
10549+ impl fmt:: Display for ResetStatement {
10550+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
10551+ match & self . reset {
10552+ Reset :: ALL => write ! ( f, "RESET ALL" ) ,
10553+ Reset :: ConfigurationParameter ( param) => write ! ( f, "RESET {}" , param) ,
10554+ }
10555+ }
10556+ }
10557+
1052210558impl From < Set > for Statement {
1052310559 fn from ( s : Set ) -> Self {
1052410560 Self :: Set ( s)
@@ -10759,6 +10795,12 @@ impl From<VacuumStatement> for Statement {
1075910795 }
1076010796}
1076110797
10798+ impl From < ResetStatement > for Statement {
10799+ fn from ( r : ResetStatement ) -> Self {
10800+ Self :: Reset ( r)
10801+ }
10802+ }
10803+
1076210804#[ cfg( test) ]
1076310805mod tests {
1076410806 use crate :: tokenizer:: Location ;
0 commit comments