In GreptimeDB, we write code like:
#[derive(Debug,Clone,PartialEq,Eq,Visit,VisitMut)]pubstructDelete{// Can only be sqlparser::ast::Statement::Delete variantpubinner:Statement,}It's because in sqlparser-rs, these statement variants are unnamed struct:
Delete{/// Multi tables delete are supported in mysqltables:Vec<ObjectName>,/// FROMfrom:Vec<TableWithJoins>,/// USING (Snowflake, Postgres, MySQL)using:Option<Vec<TableWithJoins>>,/// WHEREselection:Option<Expr>,/// RETURNINGreturning:Option<Vec<SelectItem>>,},I wonder if we can always wrap statement in a named struct so that downstream software can reuse the AST and impls (like for Display) more smoothly.
I don't know if it's a breaking change or we're generally OK with this.
Ref - GreptimeTeam/greptimedb#3646
In GreptimeDB, we write code like:
It's because in sqlparser-rs, these statement variants are unnamed struct:
I wonder if we can always wrap statement in a named struct so that downstream software can reuse the AST and impls (like for Display) more smoothly.
I don't know if it's a breaking change or we're generally OK with this.
Ref - GreptimeTeam/greptimedb#3646