MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / getJSONInvertedIndexKeyLength

Function getJSONInvertedIndexKeyLength

pkg/util/encoding/encoding.go:2560–2578  ·  view source on GitHub ↗

getJSONInvertedIndexKeyLength returns the length of encoded JSON inverted index key at the start of b.

(buf []byte)

Source from the content-addressed store, hash-verified

2558// getJSONInvertedIndexKeyLength returns the length of encoded JSON inverted index
2559// key at the start of b.
2560func getJSONInvertedIndexKeyLength(buf []byte) (int, error) {
2561 len, err := getInvertedIndexKeyLength(buf)
2562 if err != nil {
2563 return 0, err
2564 }
2565
2566 switch buf[len] {
2567 case jsonEmptyArray, jsonEmptyObject:
2568 return len + 1, nil
2569
2570 default:
2571 valLen, err := PeekLength(buf[len:])
2572 if err != nil {
2573 return 0, err
2574 }
2575
2576 return len + valLen, nil
2577 }
2578}

Callers 1

PeekLengthFunction · 0.85

Calls 2

PeekLengthFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…