Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beedb Save遇到的一个问题 #59

Open
xxjwxc opened this issue Aug 23, 2017 · 1 comment
Open

beedb Save遇到的一个问题 #59

xxjwxc opened this issue Aug 23, 2017 · 1 comment

Comments

@xxjwxc
Copy link

xxjwxc commented Aug 23, 2017

比如我拿到一个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?

@astaxie
Copy link
Owner

astaxie commented Aug 24, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants