pgx/pgtype/zeronull/zeronull.go
Jack Christensen ee93440ac1 pgtype uses pgxtest
Added ValueRoundTripTest to pgxtest
Removed pgtype/testutil

pgtype tests now run with all (applicable) query modes. This gives
better coverage than before and revealed several bugs which are also
fixed in this commit.
2022-04-02 14:34:19 -05:00

18 lines
574 B
Go

package zeronull
import (
"github.com/jackc/pgx/v5/pgtype"
)
// Register registers the zeronull types so they can be used in query exec modes that do not know the server OIDs.
func Register(m *pgtype.Map) {
m.RegisterDefaultPgType(Float8(0), "float8")
m.RegisterDefaultPgType(Int2(0), "int2")
m.RegisterDefaultPgType(Int4(0), "int4")
m.RegisterDefaultPgType(Int8(0), "int8")
m.RegisterDefaultPgType(Text(""), "text")
m.RegisterDefaultPgType(Timestamp{}, "timestamp")
m.RegisterDefaultPgType(Timestamptz{}, "timestamptz")
m.RegisterDefaultPgType(UUID{}, "uuid")
}