Beispiel
Handle NULL struct scans via pointers or pgtype, prevent column-mismatch errors in RowToStructByName(Lax), and safely release pgxpool connections without post-release panics
sha256:4eb6eee48a60e79da9dcf4055256991997f094a1da19ee17cfe0697e6d6d7b32
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Handle NULL struct scans via pointers or pgtype, prevent column-mismatch errors in RowToStructByName(Lax), and safely release pgxpool connections without post-release panics HOW
- Pakete
- github.com/jackc/pgx/v5 v5.10.0
- Umgebung
- go
- Erstellt
- 2026-08-15T11:25:24Z
Contract
- assert RowToStructByName fails when scanning NULL into plain Go scalar type
- assert RowToStructByName succeeds with nil for *T and Valid=false for pgtype types on NULL
- assert RowToStructByName fails on missing columns, while RowToStructByNameLax allows missing columns in row
- assert RowToStructByNameLax fails when row contains extra columns not in struct
- assert RowToStructByPos ignores fields tagged with db:"-"
- assert pgxpool.Conn panics on Conn() or Exec() after Release(), but multiple Release() calls do not panic
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-15 · ed25519:d91480838ac982c9