@@ -4126,7 +4126,7 @@ pub enum Statement {
4126
4126
/// A SQL query that specifies what to explain
4127
4127
statement : Box < Statement > ,
4128
4128
/// Optional output format of explain
4129
- format : Option < AnalyzeFormat > ,
4129
+ format : Option < AnalyzeFormatKind > ,
4130
4130
/// Postgres style utility options, `(analyze, verbose true)`
4131
4131
options : Option < Vec < UtilityOption > > ,
4132
4132
} ,
@@ -4494,7 +4494,7 @@ impl fmt::Display for Statement {
4494
4494
}
4495
4495
4496
4496
if let Some ( format) = format {
4497
- write ! ( f, "FORMAT {format} " ) ?;
4497
+ write ! ( f, " {format} " ) ?;
4498
4498
}
4499
4499
4500
4500
if let Some ( options) = options {
@@ -7641,13 +7641,32 @@ impl fmt::Display for DuplicateTreatment {
7641
7641
}
7642
7642
}
7643
7643
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
+
7644
7661
#[ derive( Debug , Copy , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
7645
7662
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
7646
7663
#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
7647
7664
pub enum AnalyzeFormat {
7648
7665
TEXT ,
7649
7666
GRAPHVIZ ,
7650
7667
JSON ,
7668
+ TRADITIONAL ,
7669
+ TREE
7651
7670
}
7652
7671
7653
7672
impl fmt:: Display for AnalyzeFormat {
@@ -7656,6 +7675,8 @@ impl fmt::Display for AnalyzeFormat {
7656
7675
AnalyzeFormat :: TEXT => "TEXT" ,
7657
7676
AnalyzeFormat :: GRAPHVIZ => "GRAPHVIZ" ,
7658
7677
AnalyzeFormat :: JSON => "JSON" ,
7678
+ AnalyzeFormat :: TRADITIONAL => "TRADITIONAL" ,
7679
+ AnalyzeFormat :: TREE => "TREE" ,
7659
7680
} )
7660
7681
}
7661
7682
}
0 commit comments