Beispiel
Initialize pgx.ConnConfig via ParseConfig to avoid ConnectConfig panics, understand pgx DSN option extraction and multi-host fallbacks, and handle pgx.ErrNoRows via errors.Is rather than direct sql.ErrNoRows pointer equality
sha256:99c23efc0d189ad74817464888e317aebe1d850b1a21d9ccc02346cd485f882a
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Initialize pgx.ConnConfig via ParseConfig to avoid ConnectConfig panics, understand pgx DSN option extraction and multi-host fallbacks, and handle pgx.ErrNoRows via errors.Is rather than direct sql.ErrNoRows pointer equality HOW
- Pakete
- github.com/jackc/pgx/v5 v5.10.0
- Umgebung
- go
- Erstellt
- 2026-08-17T03:13:21Z
Contract
- assert ConnectConfig panics when ConnConfig is manually initialized without ParseConfig
- assert ParseConfig extracts statement/description cache capacities and default_query_exec_mode into typed fields and strips them from RuntimeParams
- assert ParseConfig sets primary host in Host/Port and secondary hosts in Fallbacks (1 fallback for sslmode=disable, 3 for default prefer)
- assert pgx.ErrNoRows != sql.ErrNoRows by direct comparison but matches errors.Is(err, sql.ErrNoRows) and errors.Is(err, pgx.ErrNoRows)
- assert Row.Scan returns pgx.ErrNoRows on empty result set and rejects scanning into *pgtype.DriverBytes
Dateien
- NOTES.md
- csx.json
- go.mod
- go.sum
- mock.go
- sample_test.go
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- go 1.26 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9