batchInsert inserts a batch of nodes to their table and sets their ID if it was not provided by the user.
(ctx context.Context, tx dialect.ExecQuerier, insert *sql.InsertBuilder)
| 1599 | |
| 1600 | // batchInsert inserts a batch of nodes to their table and sets their ID if it was not provided by the user. |
| 1601 | func (c *batchCreator) batchInsert(ctx context.Context, tx dialect.ExecQuerier, insert *sql.InsertBuilder) error { |
| 1602 | c.ensureConflict(insert) |
| 1603 | return c.insertLastIDs(ctx, tx, insert.Returning(c.Nodes[0].ID.Column)) |
| 1604 | } |
| 1605 | |
| 1606 | // ensureConflict ensures the ON CONFLICT is added to the insert statement. |
| 1607 | func (c *batchCreator) ensureConflict(insert *sql.InsertBuilder) { |
no test coverage detected