2
0

Make pgtype test compat with CockroachDB when possible

This commit is contained in:
Jack Christensen
2022-03-22 20:31:00 -05:00
parent 210ebb4a50
commit e04b35bfcb
20 changed files with 73 additions and 1 deletions
+10
View File
@@ -8,6 +8,7 @@ import (
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgtype"
"github.com/jackc/pgx/v5/pgtype/testutil"
_ "github.com/jackc/pgx/v5/stdlib"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -66,6 +67,15 @@ func mustParseMacaddr(t testing.TB, s string) net.HardwareAddr {
return addr
}
func skipCockroachDB(t testing.TB, msg string) {
conn := testutil.MustConnectPgx(t)
defer testutil.MustCloseContext(t, conn)
if conn.PgConn().ParameterStatus("crdb_version") != "" {
t.Skip(msg)
}
}
func TestTypeMapScanNilIsNoOp(t *testing.T) {
m := pgtype.NewMap()