2
0

Fix encode to json ignoring driver.Valuer

https://github.com/jackc/pgx/issues/1430
This commit is contained in:
Jack Christensen
2022-12-23 13:44:09 -06:00
parent c4ac6d810f
commit e66ad1bcec
3 changed files with 23 additions and 0 deletions
+3
View File
@@ -52,6 +52,9 @@ func TestJSONCodec(t *testing.T) {
// Test sql.Scanner. (https://github.com/jackc/pgx/issues/1418)
{"42", new(sql.NullInt64), isExpectedEq(sql.NullInt64{Int64: 42, Valid: true})},
// Test driver.Valuer. (https://github.com/jackc/pgx/issues/1430)
{sql.NullInt64{Int64: 42, Valid: true}, new(sql.NullInt64), isExpectedEq(sql.NullInt64{Int64: 42, Valid: true})},
})
pgxtest.RunValueRoundTripTests(context.Background(), t, defaultConnTestRunner, pgxtest.KnownOIDQueryExecModes, "json", []pgxtest.ValueRoundTripTest{