Exec executes the query.
(ctx context.Context)
| 1158 | |
| 1159 | // Exec executes the query. |
| 1160 | func (u *NodeUpsertBulk) Exec(ctx context.Context) error { |
| 1161 | if u.create.err != nil { |
| 1162 | return u.create.err |
| 1163 | } |
| 1164 | for i, b := range u.create.builders { |
| 1165 | if len(b.conflict) != 0 { |
| 1166 | return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the NodeCreateBulk instead", i) |
| 1167 | } |
| 1168 | } |
| 1169 | if len(u.create.conflict) == 0 { |
| 1170 | return errors.New("ent: missing options for NodeCreateBulk.OnConflict") |
| 1171 | } |
| 1172 | return u.create.Exec(ctx) |
| 1173 | } |
| 1174 | |
| 1175 | // ExecX is like Exec, but panics if an error occurs. |
| 1176 | func (u *NodeUpsertBulk) ExecX(ctx context.Context) { |