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

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

@awkj

Description

@awkj

文档中如此描述:

插入同一个表的多条数据,此时如果数据库支持批量插入,那么会进行批量插入,但是这样每条记录就无法被自动赋予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 上实现有误还是说明有误?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions