Exec executes the query.
(ctx context.Context)
| 1549 | |
| 1550 | // Exec executes the query. |
| 1551 | func (u *MachineUpsertBulk) Exec(ctx context.Context) error { |
| 1552 | if u.create.err != nil { |
| 1553 | return u.create.err |
| 1554 | } |
| 1555 | for i, b := range u.create.builders { |
| 1556 | if len(b.conflict) != 0 { |
| 1557 | return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the MachineCreateBulk instead", i) |
| 1558 | } |
| 1559 | } |
| 1560 | if len(u.create.conflict) == 0 { |
| 1561 | return errors.New("ent: missing options for MachineCreateBulk.OnConflict") |
| 1562 | } |
| 1563 | return u.create.Exec(ctx) |
| 1564 | } |
| 1565 | |
| 1566 | // ExecX is like Exec, but panics if an error occurs. |
| 1567 | func (u *MachineUpsertBulk) ExecX(ctx context.Context) { |