@@ -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,34 @@ 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
+ /// e.g. `EXPLAIN ANALYZE FORMAT JSON SELECT * FROM tbl`
7649
+ Keyword ( AnalyzeFormat ) ,
7650
+ /// e.g. `EXPLAIN ANALYZE FORMAT=JSON SELECT * FROM tbl`
7651
+ Assignment ( AnalyzeFormat ) ,
7652
+ }
7653
+
7654
+ impl fmt:: Display for AnalyzeFormatKind {
7655
+ fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
7656
+ match self {
7657
+ AnalyzeFormatKind :: Keyword ( format) => write ! ( f, "FORMAT {format}" ) ,
7658
+ AnalyzeFormatKind :: Assignment ( format) => write ! ( f, "FORMAT={format}" ) ,
7659
+ }
7660
+ }
7661
+ }
7662
+
7644
7663
#[ derive( Debug , Copy , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
7645
7664
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
7646
7665
#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
7647
7666
pub enum AnalyzeFormat {
7648
7667
TEXT ,
7649
7668
GRAPHVIZ ,
7650
7669
JSON ,
7670
+ TRADITIONAL ,
7671
+ TREE ,
7651
7672
}
7652
7673
7653
7674
impl fmt:: Display for AnalyzeFormat {
@@ -7656,6 +7677,8 @@ impl fmt::Display for AnalyzeFormat {
7656
7677
AnalyzeFormat :: TEXT => "TEXT" ,
7657
7678
AnalyzeFormat :: GRAPHVIZ => "GRAPHVIZ" ,
7658
7679
AnalyzeFormat :: JSON => "JSON" ,
7680
+ AnalyzeFormat :: TRADITIONAL => "TRADITIONAL" ,
7681
+ AnalyzeFormat :: TREE => "TREE" ,
7659
7682
} )
7660
7683
}
7661
7684
}
0 commit comments