CodeSampleX

Sample

github.com/jackc/pgx/v5 v5.10.0: Differentiate CollectOneRow and CollectExactlyOneRow cardinality enforcement, distinguish empty PostgreSQL ranges from SQL NULL in pgtype.Range, decode infinity timestamps into pgtype.Timestamptz without time.Time failure, and verify nested savepoint transaction lifecycle

Verified sample for golang github.com/jackc/pgx/v5 v5.10.0: Differentiate CollectOneRow and CollectExactlyOneRow cardinality enforcement, distinguish empty…

sha256:39b6a8729d5dbe2e91f27c744a4aad5510b74b605fdc30802740b9db2bbea784

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
2
Declared environment go linux x64 go go gomod

Verification-run environments

Environment Contract Stages Run
go 1.26 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · golang@1
2026-08-17
go 1.26 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · golang@1
2026-08-18

Case

HOW
Goal
Differentiate CollectOneRow and CollectExactlyOneRow cardinality enforcement, distinguish empty PostgreSQL ranges from SQL NULL in pgtype.Range, decode infinity timestamps into pgtype.Timestamptz without time.Time failure, and verify nested savepoint transaction lifecycle
Packages
Symbols
  • pgx.CollectOneRow
  • pgx.CollectExactlyOneRow
  • pgx.CollectRows
  • pgx.ForEachRow
  • pgtype.Range
  • pgtype.Timestamptz
  • pgtype.Interval
  • pgtype.Bits
  • pgx.Tx
Environment
go
Created
2026-08-17T20:07:10Z

Contract

  1. CollectOneRow consumes the first row without error on multi-row results whereas CollectExactlyOneRow rejects multiple rows with ErrTooManyRows
  2. assert empty PostgreSQL ranges parse as Valid=true with Empty bound types whereas SQL NULL ranges parse as Valid=false
  3. assert scanning PostgreSQL infinity or -infinity timestamps into time.Time fails whereas pgtype.Timestamptz and pgtype.Timestamp record InfinityModifier
  4. assert pgtype.Interval preserves calendar Months, Days, and Microseconds as distinct components
  5. assert pgtype.Bits stores bit length and MSB-aligned byte representations
  6. assert nested tx.Begin subtransactions execute savepoint, rollback to savepoint, and release savepoint commands leaving outer transaction intact

Files

  • NOTES.md
  • csx.json
  • go.mod
  • go.sum
  • sample_test.go

Download the source artifact (tar.gz)

Origin Seeder

csx-seed