db icon indicating copy to clipboard operation
db copied to clipboard

Update how to get the effected rows

Open wzhsh90 opened this issue 3 years ago • 0 comments

Update method only return the error , how can i kown the update really effected rows?

func (r *Result) Update(values interface{}) error { query, err := r.buildUpdate(values) if err != nil { r.setErr(err) return err } _, err = query.Exec() r.setErr(err) return err }

my test case: 1、insert into person_info_t(id,name) values('1','1'); 2、update person_info_t set name='2' where id='1'; return nil 3、update person_info_t set name='2' where id='1'; return ni but the database dose not effect one row

only use the sql builder to sovle this problem ?

wzhsh90 avatar Jul 23 '22 02:07 wzhsh90