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

Method FormatCodeForOID

pgtype/pgtype.go:345–355  ·  view source on GitHub ↗

FormatCodeForOID returns the preferred format code for type oid. If the type is not registered it returns the text format code.

(oid uint32)

Source from the content-addressed store, hash-verified

343// FormatCodeForOID returns the preferred format code for type oid. If the type is not registered it returns the text
344// format code.
345func (m *Map) FormatCodeForOID(oid uint32) int16 {
346 if fc, ok := m.oidToFormatCode[oid]; ok {
347 return fc
348 }
349
350 if fc, ok := defaultMap.oidToFormatCode[oid]; ok {
351 return fc
352 }
353
354 return TextFormatCode
355}
356
357// EncodePlan is a precompiled plan to encode a particular type into a particular OID and format.
358type EncodePlan interface {

Callers 3

BuildMethod · 0.80

Calls

no outgoing calls