2
0

Replace EnumType with EnumCodec

This commit is contained in:
Jack Christensen
2022-01-11 20:46:10 -06:00
parent b57e0c419b
commit ae9be0b99e
5 changed files with 116 additions and 338 deletions
+1 -2
View File
@@ -918,8 +918,7 @@ func BenchmarkSelectManyRegisteredEnum(b *testing.B) {
err = conn.QueryRow(context.Background(), "select oid from pg_type where typname=$1;", "color").Scan(&oid)
require.NoError(b, err)
et := pgtype.NewEnumType("color", []string{"blue", "green", "orange"})
conn.ConnInfo().RegisterDataType(pgtype.DataType{Value: et, Name: "color", OID: oid})
conn.ConnInfo().RegisterDataType(pgtype.DataType{Name: "color", OID: oid, Codec: &pgtype.EnumCodec{}})
b.ResetTimer()
var x, y, z string