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

Function inRange

backend/plugin/parser/tsql/restore.go:428–436  ·  view source on GitHub ↗

inRange checks if a statement's position range is within the target range.

(start, end, targetStart, targetEnd *storepb.Position)

Source from the content-addressed store, hash-verified

426
427// inRange checks if a statement's position range is within the target range.
428func inRange(start, end, targetStart, targetEnd *storepb.Position) bool {
429 if start.Line < targetStart.Line || (start.Line == targetStart.Line && start.Column < targetStart.Column) {
430 return false
431 }
432 if end.Line > targetEnd.Line || (end.Line == targetEnd.Line && end.Column > targetEnd.Column) {
433 return false
434 }
435 return true
436}

Callers 2

GenerateRestoreSQLFunction · 0.70
extractStatementFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected