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

Method Encode

pgtype/composite.go:97–110  ·  pgtype/composite.go::encodePlanCompositeCodecCompositeIndexGetterToText.Encode
(value any, buf []byte)

Source from the content-addressed store, hash-verified

95}
96
97func (plan *encodePlanCompositeCodecCompositeIndexGetterToText) Encode(value any, buf []byte) (newBuf []byte, err error) {
98 getter := value.(CompositeIndexGetter)
99
100 if getter.IsNull() {
101 return nil, nil
102 }
103
104 b := NewCompositeTextBuilder(plan.m, buf)
105 for i, field := range plan.cc.Fields {
106 b.AppendValue(field.Type.OID, getter.Index(i))
107 }
108
109 return b.Finish()
110}
111
112func (c *CompositeCodec) PlanScan(m *Map, oid uint32, format int16, target any) ScanPlan {
113 switch format {

Callers

nothing calls this directly

Calls 5

AppendValueMethod · 0.95
FinishMethod · 0.95
NewCompositeTextBuilderFunction · 0.85
IsNullMethod · 0.65
IndexMethod · 0.65

Tested by

no test coverage detected