MCPcopy Index your code
hub / github.com/bytebase/bytebase / IsDDL

Function IsDDL

backend/plugin/db/util/statement_parser.go:208–215  ·  view source on GitHub ↗

IsDDL returns true if the given sql string is a DDL statement.

(query string)

Source from the content-addressed store, hash-verified

206
207// IsDDL returns true if the given sql string is a DDL statement.
208func IsDDL(query string) bool {
209 for ddl := range ddlStatements {
210 if len(query) >= len(ddl) && strings.EqualFold(query[:len(ddl)], ddl) {
211 return true
212 }
213 }
214 return false
215}
216
217// IsSelect returns true if the given sql string is a SELECT statement.
218func IsSelect(query string) bool {

Callers 3

ExecuteMethod · 0.92
QueryConnMethod · 0.92
TestIsDDLFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsDDLFunction · 0.68