gorm

https://learnku.com/docs/gorm/v2

go get -u gorm.io/gorm
go get -u gorm.io/driver/sqlite

Where

https://learnku.com/docs/gorm/v2/query/9733#6d0509



update

.Table("tsc_server_replicas").Where("id=?", wid).Update("last_timestamp", time.Now().Unix())

// 根据 `struct` 更新属性,只会更新非零值的字段
db.Model(&user).Updates(User{Name: "hello", Age: 18, Active: false})
// UPDATE users SET name='hello', age=18, updated_at = '2013-11-17 21:34:10' WHERE id = 111;

// 根据 `map` 更新属性
db.Model(&user).Updates(map[string]interface{"name": "hello", "age": 18, "actived": false})