MCPcopy Index your code
hub / github.com/jackc/pgx / Encode

Method Encode

pgtype/uuid.go:180–191  ·  view source on GitHub ↗
(value any, buf []byte)

Source from the content-addressed store, hash-verified

178type encodePlanUUIDCodecTextUUIDValuer struct{}
179
180func (encodePlanUUIDCodecTextUUIDValuer) Encode(value any, buf []byte) (newBuf []byte, err error) {
181 uuid, err := value.(UUIDValuer).UUIDValue()
182 if err != nil {
183 return nil, err
184 }
185
186 if !uuid.Valid {
187 return nil, nil
188 }
189
190 return append(buf, encodeUUID(uuid.Bytes)...), nil
191}
192
193func (UUIDCodec) PlanScan(m *Map, oid uint32, format int16, target any) ScanPlan {
194 switch format {

Callers

nothing calls this directly

Calls 2

encodeUUIDFunction · 0.85
UUIDValueMethod · 0.65

Tested by

no test coverage detected