MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetOmniNode

Function GetOmniNode

backend/plugin/parser/tidb/omni.go:112–121  ·  view source on GitHub ↗

GetOmniNode extracts the omni AST node from a base.AST interface. Returns the node and true if it is an *OmniAST, nil and false otherwise.

(a base.AST)

Source from the content-addressed store, hash-verified

110// GetOmniNode extracts the omni AST node from a base.AST interface.
111// Returns the node and true if it is an *OmniAST, nil and false otherwise.
112func GetOmniNode(a base.AST) (ast.Node, bool) {
113 if a == nil {
114 return nil, false
115 }
116 omniAST, ok := a.(*OmniAST)
117 if !ok {
118 return nil, false
119 }
120 return omniAST.Node, true
121}
122
123// ByteOffsetToRunePosition converts a byte offset in sql to a 1-based
124// line:column position, where column is measured in Unicode code points

Callers 1

TestGetOmniNodeFunction · 0.70

Calls

no outgoing calls

Tested by 1

TestGetOmniNodeFunction · 0.56