@@ -61,7 +61,7 @@ pub use self::dcl::{
6161pub use self :: ddl:: {
6262 AlterColumnOperation , AlterConnectorOwner , AlterIndexOperation , AlterPolicyOperation ,
6363 AlterSchema , AlterSchemaOperation , AlterTable , AlterTableAlgorithm , AlterTableLock ,
64- AlterTableOperation , AlterType , AlterTypeAddValue , AlterTypeAddValuePosition ,
64+ AlterTableOperation , AlterTableType , AlterType , AlterTypeAddValue , AlterTypeAddValuePosition ,
6565 AlterTypeOperation , AlterTypeRename , AlterTypeRenameValue , ClusteredBy , ColumnDef ,
6666 ColumnOption , ColumnOptionDef , ColumnOptions , ColumnPolicy , ColumnPolicyProperty ,
6767 ConstraintCharacteristics , CreateConnector , CreateDomain , CreateExtension , CreateFunction ,
@@ -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 {
@@ -4273,6 +4268,14 @@ pub enum Statement {
42734268 /// ```
42744269 /// [Redshift](https://docs.aws.amazon.com/redshift/latest/dg/r_VACUUM_command.html)
42754270 Vacuum ( VacuumStatement ) ,
4271+ /// Restore the value of a run-time parameter to the default value.
4272+ ///
4273+ /// ```sql
4274+ /// RESET configuration_parameter;
4275+ /// RESET ALL;
4276+ /// ```
4277+ /// [PostgreSQL](https://www.postgresql.org/docs/current/sql-reset.html)
4278+ Reset ( ResetStatement ) ,
42764279}
42774280
42784281impl From < Analyze > for Statement {
@@ -5767,6 +5770,7 @@ impl fmt::Display for Statement {
57675770 Statement :: AlterSchema ( s) => write ! ( f, "{s}" ) ,
57685771 Statement :: Vacuum ( s) => write ! ( f, "{s}" ) ,
57695772 Statement :: AlterUser ( s) => write ! ( f, "{s}" ) ,
5773+ Statement :: Reset ( s) => write ! ( f, "{s}" ) ,
57705774 }
57715775 }
57725776}
@@ -10565,6 +10569,38 @@ impl fmt::Display for VacuumStatement {
1056510569 }
1056610570}
1056710571
10572+ /// Variants of the RESET statement
10573+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
10574+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
10575+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
10576+ pub enum Reset {
10577+ /// Resets all session parameters to their default values.
10578+ ALL ,
10579+
10580+ /// Resets a specific session parameter to its default value.
10581+ ConfigurationParameter ( ObjectName ) ,
10582+ }
10583+
10584+ /// Resets a session parameter to its default value.
10585+ /// ```sql
10586+ /// RESET { ALL | <configuration_parameter> }
10587+ /// ```
10588+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
10589+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
10590+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
10591+ pub struct ResetStatement {
10592+ pub reset : Reset ,
10593+ }
10594+
10595+ impl fmt:: Display for ResetStatement {
10596+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
10597+ match & self . reset {
10598+ Reset :: ALL => write ! ( f, "RESET ALL" ) ,
10599+ Reset :: ConfigurationParameter ( param) => write ! ( f, "RESET {}" , param) ,
10600+ }
10601+ }
10602+ }
10603+
1056810604impl From < Set > for Statement {
1056910605 fn from ( s : Set ) -> Self {
1057010606 Self :: Set ( s)
@@ -10805,6 +10841,12 @@ impl From<VacuumStatement> for Statement {
1080510841 }
1080610842}
1080710843
10844+ impl From < ResetStatement > for Statement {
10845+ fn from ( r : ResetStatement ) -> Self {
10846+ Self :: Reset ( r)
10847+ }
10848+ }
10849+
1080810850#[ cfg( test) ]
1080910851mod tests {
1081010852 use crate :: tokenizer:: Location ;
0 commit comments