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

Method Compare

postgres/parser/json/encoded.go:568–579  ·  view source on GitHub ↗
(other JSON)

Source from the content-addressed store, hash-verified

566}
567
568func (j *jsonEncoded) Compare(other JSON) (int, error) {
569 if cmp := cmpJSONTypes(j.Type(), other.Type()); cmp != 0 {
570 return cmp, nil
571 }
572 // TODO(justin): this can be optimized in some cases. We don't necessarily
573 // need to decode all of an array or every object key.
574 dec, err := j.shallowDecode()
575 if err != nil {
576 return 0, err
577 }
578 return dec.Compare(other)
579}
580
581func (j *jsonEncoded) Exists(key string) (bool, error) {
582 if dec := j.alreadyDecoded(); dec != nil {

Callers

nothing calls this directly

Calls 5

TypeMethod · 0.95
shallowDecodeMethod · 0.95
cmpJSONTypesFunction · 0.85
TypeMethod · 0.65
CompareMethod · 0.65

Tested by

no test coverage detected