1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 19:40:55 +00:00

update annotation

This commit is contained in:
“fudali113” 2016-07-21 15:49:55 +08:00
parent e2316c4b9e
commit 3583ad8cc0
3 changed files with 8 additions and 8 deletions

View File

@ -488,9 +488,9 @@ func (d *dbBase) InsertValue(q dbQuerier, mi *modelInfo, isMulti bool, names []s
return id, err
}
//insert or update a row
// InsertOrUpdate a row
// If your primary key or unique column conflict will update
//if no will insert
// If no will insert
func (d *dbBase) InsertOrUpdate(q dbQuerier, mi *modelInfo, ind reflect.Value, tz *time.Location, dn string, args ...string) (int64, error) {
iouStr := ""
mysql := "mysql"

View File

@ -209,7 +209,7 @@ func (o *orm) InsertMulti(bulk int, mds interface{}) (int64, error) {
return cnt, nil
}
//insert or update data to database
// InsertOrUpdate data to database
func (o *orm) InsertOrUpdate(md interface{}, colConflitAndArgs ...string) (int64, error) {
mi, ind := o.getMiInd(md, true)
id, err := o.alias.DbBaser.InsertOrUpdate(o.db, mi, ind, o.alias.TZ, o.alias.DriverName, colConflitAndArgs...)