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:
Felipe Pinheiro 2026-03-23 10:41:10 -03:00
parent 6c2abe9dd1
commit ea8a35d497
No known key found for this signature in database
GPG key ID: 2A2351E155E2DD79
6 changed files with 46 additions and 36 deletions

16
go.mod
View file

@ -1,14 +1,13 @@
module github.com/go-jet/jet/v2
go 1.23.0
go 1.24.0
// used by jet generator
require (
github.com/go-sql-driver/mysql v1.9.3
github.com/google/uuid v1.6.0
github.com/jackc/pgconn v1.14.3
github.com/jackc/pgtype v1.14.4
github.com/jackc/pgx/v4 v4.18.3
github.com/jackc/pgx/v5 v5.8.0
github.com/lib/pq v1.10.9
github.com/mattn/go-sqlite3 v1.14.28
)
@ -19,7 +18,7 @@ require (
github.com/google/go-cmp v0.7.0
github.com/pkg/profile v1.7.0
github.com/shopspring/decimal v1.4.0
github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.11.1
github.com/volatiletech/null/v8 v8.1.2
gopkg.in/guregu/null.v4 v4.0.0
)
@ -33,20 +32,21 @@ require (
github.com/friendsofgo/errors v0.9.2 // indirect
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/volatiletech/inflect v0.0.1 // indirect
github.com/volatiletech/randomize v0.0.1 // indirect
github.com/volatiletech/strmangle v0.0.1 // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/crypto v0.35.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/text v0.29.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)