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

Function hasOracleFetchKeyword

backend/plugin/db/oracle/query.go:308–323  ·  view source on GitHub ↗
(sql string, loc oracleast.Loc)

Source from the content-addressed store, hash-verified

306}
307
308func hasOracleFetchKeyword(sql string, loc oracleast.Loc) bool {
309 segment := sql[loc.Start:loc.End]
310 lexer := oracleparser.NewLexer(segment)
311 for {
312 tok := lexer.NextToken()
313 if tok.Loc == tok.End && tok.End >= len(segment) {
314 return false
315 }
316 if tok.Loc < 0 || tok.End > len(segment) || tok.End <= tok.Loc {
317 return false
318 }
319 if strings.EqualFold(segment[tok.Loc:tok.End], "FETCH") {
320 return true
321 }
322 }
323}
324
325func extractOracleFetchCount(node oracleast.Node) int {
326 limit, ok := node.(*oracleast.NumberLiteral)

Callers 1

rewriteOracleFetchClauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected