beedb icon indicating copy to clipboard operation
beedb copied to clipboard

beedb Save遇到的一个问题

Open xxjwxc opened this issue 8 years ago • 1 comments

比如我拿到一个beedb.Model的orm 写出类似以下代码 orm := beedb.New(i.DB) for _, v := range Logs { value := v orm.Save(&value)//做插入操作Id自增 } 这样的代码居然只能存循环的第一个 发现是orm.PrimaryKey变了 orm := beedb.New(i.DB) for _, v := range Logs { value := v orm.SetPK("Id").Save(&value)//做插入操作Id自增 } 这样做就对了 或者: for _, v := range Logs { orm := beedb.New(i.DB) value := v orm.Save(&value)//做插入操作Id自增 } 这样做也行

这个是不是一个bug?

xxjwxc avatar Aug 23 '17 09:08 xxjwxc

已经不维护了,有问题你只能自己看源码

astaxie avatar Aug 24 '17 03:08 astaxie