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

Method TypeForOID

pgtype/pgtype.go:299–306  ·  view source on GitHub ↗

TypeForOID returns the [Type] registered for the given OID. The returned [Type] must not be mutated.

(oid uint32)

Source from the content-addressed store, hash-verified

297
298// TypeForOID returns the [Type] registered for the given OID. The returned [Type] must not be mutated.
299func (m *Map) TypeForOID(oid uint32) (*Type, bool) {
300 if dt, ok := m.oidToType[oid]; ok {
301 return dt, true
302 }
303
304 dt, ok := defaultMap.oidToType[oid]
305 return dt, ok
306}
307
308// TypeForName returns the [Type] registered for the given name. The returned [Type] must not be mutated.
309func (m *Map) TypeForName(name string) (*Type, bool) {

Callers 11

planScanMethod · 0.95
planEncodeMethod · 0.95
TestConnInitTypeMapFunction · 0.80
LoadTypeMethod · 0.80
getCompositeFieldsMethod · 0.80
ValuesMethod · 0.80
LoadTypesMethod · 0.80
ScanMethod · 0.80
newEncodeErrorFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestConnInitTypeMapFunction · 0.64