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

Method encode

postgres/parser/json/encode.go:81–90  ·  view source on GitHub ↗
(appendTo []byte)

Source from the content-addressed store, hash-verified

79}
80
81func (j jsonNumber) encode(appendTo []byte) (e jEntry, b []byte, err error) {
82 decOffset := len(appendTo)
83 dec := apd.Decimal(j)
84 appendTo = encoding.EncodeUntaggedDecimalValue(appendTo, &dec)
85 lengthInBytes := len(appendTo) - decOffset
86 if err := checkLength(lengthInBytes); err != nil {
87 return jEntry{}, b, err
88 }
89 return makeNumberJEntry(lengthInBytes), appendTo, nil
90}
91
92// encodingModeForIdx determines which encoding mode we choose to use for a
93// given i-th entry in an array or object.

Callers

nothing calls this directly

Calls 3

checkLengthFunction · 0.85
makeNumberJEntryFunction · 0.85

Tested by

no test coverage detected