@@ -2944,6 +2944,7 @@ pub enum Statement {
29442944 StartTransaction {
29452945 modes : Vec < TransactionMode > ,
29462946 begin : bool ,
2947+ transaction : Option < BeginTransactionKind > ,
29472948 /// Only for SQLite
29482949 modifier : Option < TransactionModifier > ,
29492950 } ,
@@ -4519,16 +4520,20 @@ impl fmt::Display for Statement {
45194520 Statement :: StartTransaction {
45204521 modes,
45214522 begin : syntax_begin,
4523+ transaction,
45224524 modifier,
45234525 } => {
45244526 if * syntax_begin {
45254527 if let Some ( modifier) = * modifier {
4526- write ! ( f, "BEGIN {} TRANSACTION " , modifier) ?;
4528+ write ! ( f, "BEGIN {}" , modifier) ?;
45274529 } else {
4528- write ! ( f, "BEGIN TRANSACTION " ) ?;
4530+ write ! ( f, "BEGIN" ) ?;
45294531 }
45304532 } else {
4531- write ! ( f, "START TRANSACTION" ) ?;
4533+ write ! ( f, "START" ) ?;
4534+ }
4535+ if let Some ( transaction) = transaction {
4536+ write ! ( f, " {transaction}" ) ?;
45324537 }
45334538 if !modes. is_empty ( ) {
45344539 write ! ( f, " {}" , display_comma_separated( modes) ) ?;
@@ -5023,6 +5028,24 @@ pub enum TruncateCascadeOption {
50235028 Restrict ,
50245029}
50255030
5031+ /// Transaction started with [ TRANSACTION | WORK ]
5032+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5033+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5034+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5035+ pub enum BeginTransactionKind {
5036+ Transaction ,
5037+ Work ,
5038+ }
5039+
5040+ impl Display for BeginTransactionKind {
5041+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5042+ match self {
5043+ BeginTransactionKind :: Transaction => write ! ( f, "TRANSACTION" ) ,
5044+ BeginTransactionKind :: Work => write ! ( f, "WORK" ) ,
5045+ }
5046+ }
5047+ }
5048+
50265049/// Can use to describe options in create sequence or table column type identity
50275050/// [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ]
50285051#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
0 commit comments