Skip to content
This repository was archived by the owner on Nov 17, 2019. It is now read-only.

在插入数据中疑问咨询 #12

Open
awkj opened this issue Apr 30, 2018 · 1 comment
Open

在插入数据中疑问咨询 #12

awkj opened this issue Apr 30, 2018 · 1 comment
Labels

Comments

@awkj
Copy link
Contributor

awkj commented Apr 30, 2018

文档中如此描述:

插入同一个表的多条数据,此时如果数据库支持批量插入,那么会进行批量插入,但是这样每条记录就无法被自动赋予id值。如果数据库不支持批量插入,那么就会一条一条插入。

users := make([]User, 1)
users[0].Name = "name0"
...
affected, err := engine.Insert(&users)

在 mysql 下,经过测试,开启 engine 中 engine.ShowSQL(),发现实现是通过

insert xxxx;
insert xxxx;
insert xxxx;

语句完成插入,而并非MySQL自带的 ,insert <tablename> values (xxxxx) (xxxx) 语法。

此处是在 MySQL 上实现有误还是说明有误?

@lunny lunny added the question label May 2, 2018
@lunny
Copy link
Member

lunny commented May 2, 2018

你这个example本来就是只有一个元素啊

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

No branches or pull requests

2 participants