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

Method Encode

pgtype/composite.go:77–90  ·  pgtype/composite.go::encodePlanCompositeCodecCompositeIndexGetterToBinary.Encode
(value any, buf []byte)

Source from the content-addressed store, hash-verified

75}
76
77func (plan *encodePlanCompositeCodecCompositeIndexGetterToBinary) Encode(value any, buf []byte) (newBuf []byte, err error) {
78 getter := value.(CompositeIndexGetter)
79
80 if getter.IsNull() {
81 return nil, nil
82 }
83
84 builder := NewCompositeBinaryBuilder(plan.m, buf)
85 for i, field := range plan.cc.Fields {
86 builder.AppendValue(field.Type.OID, getter.Index(i))
87 }
88
89 return builder.Finish()
90}
91
92type encodePlanCompositeCodecCompositeIndexGetterToText struct {
93 cc *CompositeCodec

Callers

nothing calls this directly

Calls 5

AppendValueMethod · 0.95
FinishMethod · 0.95
IsNullMethod · 0.65
IndexMethod · 0.65

Tested by

no test coverage detected