Beispiel
Prove clause.OnConflict upsert semantics in GORM v1.31.2 across DoNothing, UpdateAll, selective AssignmentColumns, and expression assignments
sha256:6ea5ef0092a6b25811166883f2b1f286fc1c0999ddcf7d7893350156463d99a1
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- go
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- go
- Sprache
- go
- Paketmanager
- go
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- go 1.26
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- go 1.26
- Sprache
- go
- Paketmanager
- go
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
Fall
- Ziel
- Prove clause.OnConflict upsert semantics in GORM v1.31.2 across DoNothing, UpdateAll, selective AssignmentColumns, and expression assignments HOW
- Pakete
-
gorm.io/gorm v1.31.2
github.com/glebarez/sqlite v1.11.0
- Umgebung
- go
- Erstellt
- 2026-08-17T13:42:33Z
Contract
- assert creating a conflicting record with clause.OnConflict{DoNothing: true} completes without error, reports 0 rows affected, and preserves all existing database columns unchanged
- assert creating a conflicting record with clause.OnConflict{UpdateAll: true} overwrites all mutable non-primary columns and reports 1 row affected
- assert clause.OnConflict with specific Columns and AssignmentColumns updates only designated fields while leaving other non-conflicting columns at their pre-existing values
- assert clause.OnConflict with Assignments and gorm.Expr evaluates SQL expressions such as counter increments directly during upsert
- assert batch Create with clause.OnConflict applies upsert updates to conflicting rows while inserting non-conflicting rows in the same transaction
Dateien
- NOTES.md
- csx.json
- go.mod
- go.sum
- upsert.go
- upsert_test.go
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9