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

Function sourceFromLoc

backend/plugin/parser/tsql/backup.go:518–524  ·  view source on GitHub ↗
(source string, loc ast.Loc)

Source from the content-addressed store, hash-verified

516}
517
518func sourceFromLoc(source string, loc ast.Loc) string {
519 if loc.Start < 0 || loc.End < 0 || loc.Start >= len(source) {
520 return ""
521 }
522 end := min(loc.End, len(source))
523 return strings.TrimSpace(source[loc.Start:end])
524}
525
526func positionFromByteOffset(start *storepb.Position, source string, offset int) *storepb.Position {
527 if offset < 0 {

Callers 3

dmlFromSourceFunction · 0.85
extractStatementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected