MCPcopy
hub / github.com/github/gh-ost / ToEventDML

Function ToEventDML

go/binlog/binlog_dml_event.go:24–45  ·  view source on GitHub ↗
(description string)

Source from the content-addressed store, hash-verified

22)
23
24func ToEventDML(description string) EventDML {
25 // description can be a statement (`UPDATE my_table ...`) or a RBR event name (`UpdateRowsEventV2`)
26 description = strings.TrimSpace(strings.Split(description, " ")[0])
27 switch strings.ToLower(description) {
28 case "insert":
29 return InsertDML
30 case "update":
31 return UpdateDML
32 case "delete":
33 return DeleteDML
34 }
35 if strings.HasPrefix(description, "WriteRows") {
36 return InsertDML
37 }
38 if strings.HasPrefix(description, "UpdateRows") {
39 return UpdateDML
40 }
41 if strings.HasPrefix(description, "DeleteRows") {
42 return DeleteDML
43 }
44 return NotDML
45}
46
47// BinlogDMLEvent is a binary log rows (DML) event entry, with data
48type BinlogDMLEvent struct {

Callers 1

handleRowsEventMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…