MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / UpdateNewValues

Method UpdateNewValues

ent/task_create.go:482–493  ·  view source on GitHub ↗

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)

()

Source from the content-addressed store, hash-verified

480// ).
481// Exec(ctx)
482func (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:

Callers

nothing calls this directly

Calls 2

CreatedAtMethod · 0.65
CorrelationIDMethod · 0.65

Tested by

no test coverage detected