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

Function isSelectOrWithStatement

backend/plugin/db/oracle/query.go:202–205  ·  view source on GitHub ↗

isSelectOrWithStatement checks if the statement is a SELECT or WITH statement

(statement string)

Source from the content-addressed store, hash-verified

200
201// isSelectOrWithStatement checks if the statement is a SELECT or WITH statement
202func isSelectOrWithStatement(statement string) bool {
203 trimmedStatement := strings.ToLower(strings.TrimLeftFunc(statement, unicode.IsSpace))
204 return strings.HasPrefix(trimmedStatement, "select") || strings.HasPrefix(trimmedStatement, "with")
205}
206
207// addLimitFor12cAndLater adds a FETCH NEXT clause for Oracle 12c and later versions.
208// Uses the modern SQL standard approach, falling back to 11g approach on error.

Callers 2

addLimitFor11gFunction · 0.85
addLimitFor12cAndLaterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected