MCPcopy
hub / github.com/jackc/pgx / EncodeBinary

Method EncodeBinary

pgtype/array.go:83–100  ·  view source on GitHub ↗
(buf []byte)

Source from the content-addressed store, hash-verified

81}
82
83func (src arrayHeader) EncodeBinary(buf []byte) []byte {
84 buf = pgio.AppendInt32(buf, int32(len(src.Dimensions)))
85
86 var containsNull int32
87 if src.ContainsNull {
88 containsNull = 1
89 }
90 buf = pgio.AppendInt32(buf, containsNull)
91
92 buf = pgio.AppendUint32(buf, src.ElementOID)
93
94 for i := range src.Dimensions {
95 buf = pgio.AppendInt32(buf, src.Dimensions[i].Length)
96 buf = pgio.AppendInt32(buf, src.Dimensions[i].LowerBound)
97 }
98
99 return buf
100}
101
102type untypedTextArray struct {
103 Elements []string

Callers 1

EncodeMethod · 0.95

Calls 2

AppendInt32Function · 0.92
AppendUint32Function · 0.92

Tested by

no test coverage detected