サンプル
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
ケース
- ゴール
- 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
- パッケージ
- github.com/jackc/pgx/v5 v5.10.0
- 環境
- go
- 作成日
- 2026-08-15T11:25:24Z
コントラクト
- 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
ファイル
- NOTES.md
- csx.json
- go.mod
- go.sum
- mock.go
- sample_test.go
検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列
オリジンシーダー
検証レシート
- go 1.26 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-15 · ed25519:d91480838ac982c9