- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for setColumn (0.23 sec)
-
tests/hooks_test.go
} func (s Product3) BeforeCreate(tx *gorm.DB) (err error) { tx.Statement.SetColumn("Price", s.Price+100) return nil } func (s Product3) BeforeUpdate(tx *gorm.DB) (err error) { if tx.Statement.Changed() { tx.Statement.SetColumn("Price", s.Price+10) } if tx.Statement.Changed("Code") { s.Price += 20 tx.Statement.SetColumn("Price", s.Price+30) } return nil }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Sat Feb 18 01:20:29 GMT 2023 - 15.9K bytes - Viewed (0)