Ash.Query.UpsertConflict (ash v3.29.1)

Copy Markdown View Source

Refers to the incoming value of a field during an upsert.

Only valid in expressions evaluated during an upsert, such as an upsert_condition. When an upsert finds a conflicting record, a bare field reference refers to the value already in the database, while upsert_conflict(:field) refers to the value that the current create attempted to set.

For example, to skip the upsert unless the incoming contents differ from the stored value:

upsert_condition expr(contents != upsert_conflict(:contents))

See the create actions guide for more.

Summary

Functions

new(attribute)