UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using: client.Machine.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
()
| 734 | // ). |
| 735 | // Exec(ctx) |
| 736 | func (u *MachineUpsertOne) UpdateNewValues() *MachineUpsertOne { |
| 737 | u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) |
| 738 | u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { |
| 739 | if _, exists := u.create.mutation.CreatedAt(); exists { |
| 740 | s.SetIgnore(machine.FieldCreatedAt) |
| 741 | } |
| 742 | if _, exists := u.create.mutation.MachineId(); exists { |
| 743 | s.SetIgnore(machine.FieldMachineId) |
| 744 | } |
| 745 | })) |
| 746 | return u |
| 747 | } |
| 748 | |
| 749 | // Ignore sets each column to itself in case of conflict. |
| 750 | // Using this option is equivalent to using: |