RegisterType registers a data type with the [Map]. t must not be mutated after it is registered.
(t *Type)
| 271 | |
| 272 | // RegisterType registers a data type with the [Map]. t must not be mutated after it is registered. |
| 273 | func (m *Map) RegisterType(t *Type) { |
| 274 | m.oidToType[t.OID] = t |
| 275 | m.nameToType[t.Name] = t |
| 276 | m.oidToFormatCode[t.OID] = t.Codec.PreferredFormat() |
| 277 | |
| 278 | // Invalidated by type registration |
| 279 | m.reflectTypeToType = nil |
| 280 | for k := range m.memoizedEncodePlans { |
| 281 | delete(m.memoizedEncodePlans, k) |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | // RegisterDefaultPgType registers a mapping of a Go type to a PostgreSQL type name. Typically the data type to be |
| 286 | // encoded or decoded is determined by the PostgreSQL OID. But if the OID of a value to be encoded or decoded is |