Remove pgproto3/v2 dep by upgrading pgx/v4 to v5
pgx/v4/stdlib was only used in test infrastructure, but its transitive dependency on jackc/pgproto3/v2 exposed the build to GO-2026-4518 (DoS via negative field length panic in DataRow.Decode). Replaces the pgconn.ParseConfig call via GenerateDSN with url.Parse for DSN validation, and SELECT current_database() for retrieving the database name, removing the last non-test dependency on the pgx/v4. Updates TestUInt64Overflow in tests/postgres to match pgx/v5 error format: v5 renamed Int to Int64 across pgtype to match database/sql conventions, so the overflow error now says "int64" instead of "Int8". Bumps minimum Go version to 1.24 (required by pgx/v5).
This commit is contained in:
parent
6c2abe9dd1
commit
ea8a35d497
6 changed files with 46 additions and 36 deletions
|
|
@ -1067,7 +1067,7 @@ func TestUInt64Overflow(t *testing.T) {
|
|||
|
||||
_, err := stmt.Exec(db)
|
||||
if isPgxDriver() {
|
||||
require.ErrorContains(t, err, "18446744073709551615 is greater than maximum value for Int8")
|
||||
require.ErrorContains(t, err, "18446744073709551615 is greater than maximum value for int64")
|
||||
} else {
|
||||
require.ErrorContains(t, err, "sql: converting argument $1 type: uint64 values with high bit set are not supported")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import (
|
|||
"github.com/go-jet/jet/v2/qrm"
|
||||
"github.com/go-jet/jet/v2/stmtcache"
|
||||
"github.com/go-jet/jet/v2/tests/internal/utils/repo"
|
||||
"github.com/jackc/pgx/v4/stdlib"
|
||||
"github.com/jackc/pgx/v5/stdlib"
|
||||
|
||||
"github.com/go-jet/jet/v2/postgres"
|
||||
"github.com/go-jet/jet/v2/tests/dbconfig"
|
||||
|
|
@ -20,7 +20,7 @@ import (
|
|||
"github.com/pkg/profile"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
_ "github.com/jackc/pgx/v4/stdlib"
|
||||
_ "github.com/jackc/pgx/v5/stdlib"
|
||||
)
|
||||
|
||||
var ctx = context.Background()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue