MCPcopy Create free account
hub / github.com/dolthub/doltgresql / FetchValKeyOrIdx

Method FetchValKeyOrIdx

postgres/parser/json/encoded.go:629–644  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

627}
628
629func (j *jsonEncoded) FetchValKeyOrIdx(key string) (JSON, error) {
630 switch j.typ {
631 case ObjectJSONType:
632 return j.FetchValKey(key)
633 case ArrayJSONType:
634 idx, err := strconv.Atoi(key)
635 if err != nil {
636 // We shouldn't return this error because it means we couldn't parse the
637 // number, meaning it was a string and that just means we can't find the
638 // value in an array.
639 return nil, nil //nolint:returnerrcheck
640 }
641 return j.FetchValIdx(idx)
642 }
643 return nil, nil
644}
645
646func (j *jsonEncoded) Format(buf *bytes.Buffer) {
647 decoded, err := j.decode()

Callers

nothing calls this directly

Calls 2

FetchValKeyMethod · 0.95
FetchValIdxMethod · 0.95

Tested by

no test coverage detected