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

Function GetStatementTypes

backend/plugin/parser/base/interface.go:310–316  ·  view source on GitHub ↗

GetStatementTypes returns the types of statements in the ASTs.

(engine storepb.Engine, asts []AST)

Source from the content-addressed store, hash-verified

308
309// GetStatementTypes returns the types of statements in the ASTs.
310func GetStatementTypes(engine storepb.Engine, asts []AST) ([]storepb.StatementType, error) {
311 f, ok := statementTypeGetters[engine]
312 if !ok {
313 return nil, errors.Errorf("engine %s is not supported", engine)
314 }
315 return f(asts)
316}
317
318// IsAllDML checks if all statements are DML (INSERT, UPDATE, DELETE).
319// Returns false for unsupported engines or parse errors (conservative approach).

Callers 2

ContainsDDLFunction · 0.92
isAllDMLImplFunction · 0.70

Calls 2

fFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected