forked from xelabs/go-mysqlstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtxn.go
More file actions
37 lines (29 loc) · 806 Bytes
/
txn.go
File metadata and controls
37 lines (29 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sqlparser
import ()
const (
// StartTxnStr represents the txn start.
StartTxnStr = "start transaction"
// CommitTxnStr represents the txn commit.
CommitTxnStr = "commit"
)
// Transaction represents the transaction tuple.
type Transaction struct {
Action string
}
func (*Transaction) iStatement() {}
// Format formats the node.
func (node *Transaction) Format(buf *TrackedBuffer) {
switch node.Action {
case StartTxnStr:
buf.WriteString(StartTxnStr)
case CommitTxnStr:
buf.WriteString(CommitTxnStr)
}
}
// WalkSubtree walks the nodes of the subtree.
func (node *Transaction) WalkSubtree(visit Visit) error {
return nil
}