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

Function IsSelect

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

IsSelect returns true if the given sql string is a SELECT statement.

(query string)

Source from the content-addressed store, hash-verified

216
217// IsSelect returns true if the given sql string is a SELECT statement.
218func IsSelect(query string) bool {
219 for keyword := range selectStatements {
220 if len(query) >= len(keyword) && strings.EqualFold(query[:len(keyword)], keyword) {
221 return true
222 }
223 }
224 return false
225}

Callers 3

QueryConnMethod · 0.92
QueryConnMethod · 0.92
TestIsSelectFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsSelectFunction · 0.68