@@ -4126,7 +4126,7 @@ pub enum Statement {
41264126 /// A SQL query that specifies what to explain
41274127 statement : Box < Statement > ,
41284128 /// Optional output format of explain
4129- format : Option < AnalyzeFormat > ,
4129+ format : Option < AnalyzeFormatKind > ,
41304130 /// Postgres style utility options, `(analyze, verbose true)`
41314131 options : Option < Vec < UtilityOption > > ,
41324132 } ,
@@ -4494,7 +4494,7 @@ impl fmt::Display for Statement {
44944494 }
44954495
44964496 if let Some ( format) = format {
4497- write ! ( f, "FORMAT {format} " ) ?;
4497+ write ! ( f, " {format} " ) ?;
44984498 }
44994499
45004500 if let Some ( options) = options {
@@ -7641,13 +7641,32 @@ impl fmt::Display for DuplicateTreatment {
76417641 }
76427642}
76437643
7644+ #[ derive( Debug , Copy , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
7645+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
7646+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
7647+ pub enum AnalyzeFormatKind {
7648+ Keyword ( AnalyzeFormat ) ,
7649+ Assignment ( AnalyzeFormat )
7650+ }
7651+
7652+ impl fmt:: Display for AnalyzeFormatKind {
7653+ fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
7654+ match self {
7655+ AnalyzeFormatKind :: Keyword ( format) => write ! ( f, "FORMAT {format}" ) ,
7656+ AnalyzeFormatKind :: Assignment ( format) => write ! ( f, "FORMAT={format}" ) ,
7657+ }
7658+ }
7659+ }
7660+
76447661#[ derive( Debug , Copy , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
76457662#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
76467663#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
76477664pub enum AnalyzeFormat {
76487665 TEXT ,
76497666 GRAPHVIZ ,
76507667 JSON ,
7668+ TRADITIONAL ,
7669+ TREE
76517670}
76527671
76537672impl fmt:: Display for AnalyzeFormat {
@@ -7656,6 +7675,8 @@ impl fmt::Display for AnalyzeFormat {
76567675 AnalyzeFormat :: TEXT => "TEXT" ,
76577676 AnalyzeFormat :: GRAPHVIZ => "GRAPHVIZ" ,
76587677 AnalyzeFormat :: JSON => "JSON" ,
7678+ AnalyzeFormat :: TRADITIONAL => "TRADITIONAL" ,
7679+ AnalyzeFormat :: TREE => "TREE" ,
76597680 } )
76607681 }
76617682}
0 commit comments