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). |
||
|---|---|---|
| .. | ||
| dbconfig | ||
| init | ||
| internal/utils | ||
| mysql | ||
| postgres | ||
| sqlite | ||
| testdata@5003c4883c | ||
| docker-compose.yaml | ||
| Makefile | ||
| Readme.md | ||
Integration tests
This folder contains integration tests intended to test jet generator, statements and query result mapping with a running database.
How to run tests?
Before we can run tests, we need to set up and initialize test databases. To simplify the process there is a Makefile with a list of helper commands.
# We first need to checkout testdata from separate repository into git submodule,
# then download docker image for each of the databases listed in docker-compose.yaml file, and
# finally run and initialize databases with downloaded test data.
# Note that on the first run this command might take a couple of minutes.
make setup
# When databases are ready, we can generate sql builder and model types for each of the test databases
make jet-gen-all
Then we can run the tests the usual way:
go test -v ./...
To removes test containers, volumes, and images:
make cleanup