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

Function ParseTiDBOmni

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

ParseTiDBOmni parses SQL using omni/tidb's parser and returns an ast.List. This is the recommended entry point for new code that needs omni/tidb AST nodes. Callers that need a pre-split []base.ParsedStatement should use the registered base.ParseStatements with storepb.Engine_TIDB instead.

(sql string)

Source from the content-addressed store, hash-verified

104// nodes. Callers that need a pre-split []base.ParsedStatement should use the
105// registered base.ParseStatements with storepb.Engine_TIDB instead.
106func ParseTiDBOmni(sql string) (*ast.List, error) {
107 return omniparser.Parse(sql)
108}
109
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.

Callers 8

prepareTransformationFunction · 0.85
parseCTEPrefixFunction · 0.85
TestGetOmniNodeFunction · 0.85
findMatchingDMLsFunction · 0.85
extractStatementFunction · 0.85
parseTiDBStatementsOmniFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestGetOmniNodeFunction · 0.68