CodeSampleX

Sample

sqlite.Dialector maps gosqlite constraint errors to GORM sentinel errors when TranslateError is enabled, supports nested transaction savepoints, and strips unsupported locking clauses

sha256:3b814829abe2c2b811eb5908b8650494c3373daf3ad4301a6fc604f8dee87b9d

PUBLISHED L3_CONTRACT_PASS MIT-0

Execution evidence

Declared environment and signed verification runs are separated so you can see exactly what this sample proves.

Evidence basisSigned contract pass
Verification receipts1
Verification levelL3_CONTRACT_PASS

Declared environment

Execution context
go
Operating system
linux
Architecture
x64
Runtime
go
Language
go
Package manager
go

Verification-run environments

Execution context
go 1.26
Operating system
linux alpine · musl
Architecture
x64
Runtime
go 1.26
Language
go
Package manager
go
Execution
container · docker

CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17

Case

Goal
sqlite.Dialector maps gosqlite constraint errors to GORM sentinel errors when TranslateError is enabled, supports nested transaction savepoints, and strips unsupported locking clauses HOW
Packages
github.com/glebarez/sqlite 1.11.0 gorm.io/gorm 1.25.7
Environment
go
Created
2026-08-17T18:22:13Z

Commonly assumed

gorm.Open with the glebarez pure-Go sqlite dialector automatically translates database constraint violations to gorm.ErrDuplicatedKey or gorm.ErrForeignKeyViolated by default without setting TranslateError

The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.

Contract

Files

Download the source artifact (tar.gz)

Origin Seeder

csx-seed

Verification receipts