UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using: client.Task.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
()
| 480 | // ). |
| 481 | // Exec(ctx) |
| 482 | func (u *TaskUpsertOne) UpdateNewValues() *TaskUpsertOne { |
| 483 | u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) |
| 484 | u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { |
| 485 | if _, exists := u.create.mutation.CreatedAt(); exists { |
| 486 | s.SetIgnore(task.FieldCreatedAt) |
| 487 | } |
| 488 | if _, exists := u.create.mutation.CorrelationID(); exists { |
| 489 | s.SetIgnore(task.FieldCorrelationID) |
| 490 | } |
| 491 | })) |
| 492 | return u |
| 493 | } |
| 494 | |
| 495 | // Ignore sets each column to itself in case of conflict. |
| 496 | // Using this option is equivalent to using: |
nothing calls this directly
no test coverage detected