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

Function ByteOffsetToRunePosition

backend/plugin/parser/pg/omni.go:47–49  ·  view source on GitHub ↗

ByteOffsetToRunePosition converts a byte offset in sql to a 1-based line:column where column is measured in Unicode code points (runes), matching storepb.Position semantics.

(sql string, byteOffset int)

Source from the content-addressed store, hash-verified

45// ByteOffsetToRunePosition converts a byte offset in sql to a 1-based line:column
46// where column is measured in Unicode code points (runes), matching storepb.Position semantics.
47func ByteOffsetToRunePosition(sql string, byteOffset int) *storepb.Position {
48 return base.NewByteOffsetPositionMapper(sql).Position(byteOffset)
49}

Callers 4

parsePostgreSQLStatementFunction · 0.70
convertOmniErrorFunction · 0.70
getQuerySpanMethod · 0.70

Calls 2

PositionMethod · 0.80

Tested by 1