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

Function GetOffsetLength

backend/plugin/parser/base/base.go:17–26  ·  view source on GitHub ↗
(total int)

Source from the content-addressed store, hash-verified

15}
16
17func GetOffsetLength(total int) int {
18 length := 1
19 for {
20 if total < 10 {
21 return length
22 }
23 total /= 10
24 length++
25 }
26}
27
28// GetLineOffset returns the 0-based line offset from a StartPosition.
29// This is useful for converting from the 1-based StartPosition to the 0-based offset

Callers 1

generateSQLForMixedDMLFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected