CodeSampleX

Sample

gorm.io/gorm v1.31.2: Measure association loading, filtering, creation, and deletion behavior in GORM 1.31.2 with the pinned in-memory SQLite driver

Verified sample for golang gorm.io/gorm v1.31.2: Measure association loading, filtering, creation, and deletion behavior in GORM 1.31.2 with the pinned…

sha256:c46b7eb8fabdc140ce3ea2b636aaf5d4c76312d0d78f9724cfaf8fcc350978a8

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 go

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
Measure association loading, filtering, creation, and deletion behavior in GORM 1.31.2 with the pinned in-memory SQLite driver
Packages
Symbols
  • gorm.Open
  • DB.Preload
  • DB.Joins
  • DB.Where
  • DB.Find
  • DB.Delete
  • DB.Create
  • DB.Select
  • DB.Omit
  • clause.Associations
Environment
go
Created
2026-08-17T03:54:31Z

Contract

  1. assert Preload with a condition returns both parent records and leaves the nonmatching parent's child slice empty
  2. assert Preload plus a root Where on the unjoined child table returns a no such column SQL error
  3. assert Joins on the tested HasMany slice relation panics during reflection instead of populating the slice
  4. assert Joins on the tested HasOne relation returns one matching parent and populates its nested struct
  5. assert an explicit SQL join with Distinct filters the parent records and conditional Preload attaches the matching child
  6. assert plain Delete leaves the seeded child rows present in the test database
  7. assert Select with clause.Associations on Delete removes the seeded child rows
  8. assert Omit with clause.Associations on Create inserts only the parent row

Files

  • NOTES.md
  • csx.json
  • go.mod
  • go.sum
  • relations.go
  • relations_test.go

Download the source artifact (tar.gz)

Origin Seeder

csx-seed