MCPcopy Create free account
hub / github.com/cloudspannerecosystem/spanner-cli / newBeginRwStatement

Function newBeginRwStatement

statement.go:999–1024  ·  view source on GitHub ↗
(input string)

Source from the content-addressed store, hash-verified

997}
998
999func newBeginRwStatement(input string) (*BeginRwStatement, error) {
1000 matched := beginRwRe.FindStringSubmatch(input)
1001 stmt := &BeginRwStatement{}
1002
1003 if matched[1] != "" {
1004 isolationLevel, err := parseIsolationLevel(matched[1])
1005 if err != nil {
1006 return nil, err
1007 }
1008 stmt.IsolationLevel = isolationLevel
1009 }
1010
1011 if matched[2] != "" {
1012 priority, err := parsePriority(matched[2])
1013 if err != nil {
1014 return nil, err
1015 }
1016 stmt.Priority = priority
1017 }
1018
1019 if matched[3] != "" {
1020 stmt.Tag = matched[3]
1021 }
1022
1023 return stmt, nil
1024}
1025
1026func (s *BeginRwStatement) Execute(ctx context.Context, session *Session) (*Result, error) {
1027 if session.InReadWriteTransaction() {

Callers 1

Calls 2

parseIsolationLevelFunction · 0.85
parsePriorityFunction · 0.85

Tested by

no test coverage detected