MCPcopy
hub / github.com/go-gorm/gorm / Update

Method Update

finisher_api.go:413–417  ·  view source on GitHub ↗

Update updates column with value using callbacks. Reference: https://gorm.io/docs/update.html#Update-Changed-Fields

(column string, value interface{})

Source from the content-addressed store, hash-verified

411
412// Update updates column with value using callbacks. Reference: https://gorm.io/docs/update.html#Update-Changed-Fields
413func (db *DB) Update(column string, value interface{}) (tx *DB) {
414 tx = db.getInstance()
415 tx.Statement.Dest = map[string]interface{}{column: value}
416 return tx.callbacks.Update().Execute(tx)
417}
418
419// Updates updates attributes using callbacks. values must be a struct or map. Reference: https://gorm.io/docs/update.html#Update-Changed-Fields
420func (db *DB) Updates(values interface{}) (tx *DB) {

Callers

nothing calls this directly

Calls 3

getInstanceMethod · 0.95
ExecuteMethod · 0.80
UpdateMethod · 0.65

Tested by

no test coverage detected