请问 gorm 如何获取到更新后的值
資深大佬 : swxc 3
type Counter struct { BizName string `gorm:"primary_key"` NextId string CreatedAt time.Time } counter := model.Counter{BizName: "class"} err = d.Model(&counter).Update(ctx, "next_id", gorm.Expr("next_id + ?",1)).Error
想实现一个简易的发号器,想利用 mysql update 的原子性,更新 NextId 并获取到更新后的值,请问如何搞定
大佬有話說 (4)