go-gorm / gorm

The fantastic ORM library for Golang, aims to be developer friendly
https://gorm.io
MIT License
36.03k stars 3.86k forks source link

Allow modification of null values #7064

Open enzofoucaud opened 3 weeks ago

enzofoucaud commented 3 weeks ago

Describe the feature

Allow me to updates non zero value

Motivation

map[string]interface{} is complicated to use when you have complex structures like :

type Component struct {
    gorm.Model
    FamilyID               uint
    Name                   string
        ...

    // Relationships
    1 []1 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
    2 []2 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
    3 []3 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
    4 []4 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
    5 []5 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
        ...

    // Relationships others
    10 []10 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
    11 []11 `gorm:"ForeignKey:ComponentID;constraint:OnUpdate:CASCADE"`
}

Related Issues

3901

Description

maybe add :

maybe fix :