@@ -120,7 +120,6 @@ pub mod helpers;
120120mod operator;
121121mod query;
122122mod spans;
123- mod statement_from_impls;
124123pub use spans:: Spanned ;
125124
126125mod trigger;
@@ -10700,6 +10699,204 @@ impl fmt::Display for VacuumStatement {
1070010699 }
1070110700}
1070210701
10702+ impl From < Set > for Statement {
10703+ fn from ( s : Set ) -> Self {
10704+ Self :: Set ( s)
10705+ }
10706+ }
10707+
10708+ impl From < Query > for Statement {
10709+ fn from ( q : Query ) -> Self {
10710+ Box :: new ( q) . into ( )
10711+ }
10712+ }
10713+
10714+ impl From < Box < Query > > for Statement {
10715+ fn from ( q : Box < Query > ) -> Self {
10716+ Self :: Query ( q)
10717+ }
10718+ }
10719+
10720+ impl From < Insert > for Statement {
10721+ fn from ( i : Insert ) -> Self {
10722+ Self :: Insert ( i)
10723+ }
10724+ }
10725+
10726+ impl From < CaseStatement > for Statement {
10727+ fn from ( c : CaseStatement ) -> Self {
10728+ Self :: Case ( c)
10729+ }
10730+ }
10731+
10732+ impl From < IfStatement > for Statement {
10733+ fn from ( i : IfStatement ) -> Self {
10734+ Self :: If ( i)
10735+ }
10736+ }
10737+
10738+ impl From < WhileStatement > for Statement {
10739+ fn from ( w : WhileStatement ) -> Self {
10740+ Self :: While ( w)
10741+ }
10742+ }
10743+
10744+ impl From < RaiseStatement > for Statement {
10745+ fn from ( r : RaiseStatement ) -> Self {
10746+ Self :: Raise ( r)
10747+ }
10748+ }
10749+
10750+ impl From < Function > for Statement {
10751+ fn from ( f : Function ) -> Self {
10752+ Self :: Call ( f)
10753+ }
10754+ }
10755+
10756+ impl From < OpenStatement > for Statement {
10757+ fn from ( o : OpenStatement ) -> Self {
10758+ Self :: Open ( o)
10759+ }
10760+ }
10761+
10762+ impl From < Delete > for Statement {
10763+ fn from ( d : Delete ) -> Self {
10764+ Self :: Delete ( d)
10765+ }
10766+ }
10767+
10768+ impl From < CreateTable > for Statement {
10769+ fn from ( c : CreateTable ) -> Self {
10770+ Self :: CreateTable ( c)
10771+ }
10772+ }
10773+
10774+ impl From < CreateIndex > for Statement {
10775+ fn from ( c : CreateIndex ) -> Self {
10776+ Self :: CreateIndex ( c)
10777+ }
10778+ }
10779+
10780+ impl From < CreateServerStatement > for Statement {
10781+ fn from ( c : CreateServerStatement ) -> Self {
10782+ Self :: CreateServer ( c)
10783+ }
10784+ }
10785+
10786+ impl From < CreateConnector > for Statement {
10787+ fn from ( c : CreateConnector ) -> Self {
10788+ Self :: CreateConnector ( c)
10789+ }
10790+ }
10791+
10792+ impl From < AlterSchema > for Statement {
10793+ fn from ( a : AlterSchema ) -> Self {
10794+ Self :: AlterSchema ( a)
10795+ }
10796+ }
10797+
10798+ impl From < AlterType > for Statement {
10799+ fn from ( a : AlterType ) -> Self {
10800+ Self :: AlterType ( a)
10801+ }
10802+ }
10803+
10804+ impl From < DropDomain > for Statement {
10805+ fn from ( d : DropDomain ) -> Self {
10806+ Self :: DropDomain ( d)
10807+ }
10808+ }
10809+
10810+ impl From < ShowCharset > for Statement {
10811+ fn from ( s : ShowCharset ) -> Self {
10812+ Self :: ShowCharset ( s)
10813+ }
10814+ }
10815+
10816+ impl From < ShowObjects > for Statement {
10817+ fn from ( s : ShowObjects ) -> Self {
10818+ Self :: ShowObjects ( s)
10819+ }
10820+ }
10821+
10822+ impl From < Use > for Statement {
10823+ fn from ( u : Use ) -> Self {
10824+ Self :: Use ( u)
10825+ }
10826+ }
10827+
10828+ impl From < CreateFunction > for Statement {
10829+ fn from ( c : CreateFunction ) -> Self {
10830+ Self :: CreateFunction ( c)
10831+ }
10832+ }
10833+
10834+ impl From < CreateTrigger > for Statement {
10835+ fn from ( c : CreateTrigger ) -> Self {
10836+ Self :: CreateTrigger ( c)
10837+ }
10838+ }
10839+
10840+ impl From < DropTrigger > for Statement {
10841+ fn from ( d : DropTrigger ) -> Self {
10842+ Self :: DropTrigger ( d)
10843+ }
10844+ }
10845+
10846+ impl From < DenyStatement > for Statement {
10847+ fn from ( d : DenyStatement ) -> Self {
10848+ Self :: Deny ( d)
10849+ }
10850+ }
10851+
10852+ impl From < CreateDomain > for Statement {
10853+ fn from ( c : CreateDomain ) -> Self {
10854+ Self :: CreateDomain ( c)
10855+ }
10856+ }
10857+
10858+ impl From < RenameTable > for Statement {
10859+ fn from ( r : RenameTable ) -> Self {
10860+ vec ! [ r] . into ( )
10861+ }
10862+ }
10863+
10864+ impl From < Vec < RenameTable > > for Statement {
10865+ fn from ( r : Vec < RenameTable > ) -> Self {
10866+ Self :: RenameTable ( r)
10867+ }
10868+ }
10869+
10870+ impl From < PrintStatement > for Statement {
10871+ fn from ( p : PrintStatement ) -> Self {
10872+ Self :: Print ( p)
10873+ }
10874+ }
10875+
10876+ impl From < ReturnStatement > for Statement {
10877+ fn from ( r : ReturnStatement ) -> Self {
10878+ Self :: Return ( r)
10879+ }
10880+ }
10881+
10882+ impl From < ExportData > for Statement {
10883+ fn from ( e : ExportData ) -> Self {
10884+ Self :: ExportData ( e)
10885+ }
10886+ }
10887+
10888+ impl From < CreateUser > for Statement {
10889+ fn from ( c : CreateUser ) -> Self {
10890+ Self :: CreateUser ( c)
10891+ }
10892+ }
10893+
10894+ impl From < VacuumStatement > for Statement {
10895+ fn from ( v : VacuumStatement ) -> Self {
10896+ Self :: Vacuum ( v)
10897+ }
10898+ }
10899+
1070310900#[ cfg( test) ]
1070410901mod tests {
1070510902 use crate :: tokenizer:: Location ;
0 commit comments