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

Function decodeIfNeeded

postgres/parser/json/json.go:432–441  ·  view source on GitHub ↗
(j JSON)

Source from the content-addressed store, hash-verified

430func (j jsonTrue) Compare(other JSON) (int, error) { return cmpJSONTypes(j.Type(), other.Type()), nil }
431
432func decodeIfNeeded(j JSON) (JSON, error) {
433 if enc, ok := j.(*jsonEncoded); ok {
434 var err error
435 j, err = enc.decode()
436 if err != nil {
437 return nil, err
438 }
439 }
440 return j, nil
441}
442
443func (j jsonNumber) Compare(other JSON) (int, error) {
444 cmp := cmpJSONTypes(j.Type(), other.Type())

Callers 4

CompareMethod · 0.85
CompareMethod · 0.85
CompareMethod · 0.85
CompareMethod · 0.85

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected