MCPcopy
hub / github.com/crowdsecurity/crowdsec / UpdateNewValues

Method UpdateNewValues

pkg/database/ent/machine_create.go:736–747  ·  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.Machine.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)

()

Source from the content-addressed store, hash-verified

734// ).
735// Exec(ctx)
736func (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:

Callers

nothing calls this directly

Calls 2

MachineIdMethod · 0.80
CreatedAtMethod · 0.45

Tested by

no test coverage detected