What is the on_conflict: :nothing or :raise equivalento in Ash?

What is the on_conflict: :nothing or :raise equivalento in Ash?

i believe for nothing it would be something like upsert_fields [] but I’m not 100% sure.

Yeah, actually it is the other way around, upsert_fields: [] would be more equal to on_conflict: :raise since it will fail because it can’t change the resource attributes sent via the create action.

Now, I can’t see how to have a upsert that is equivalent to on_conflict: :nothing

Morning @sezaru :wave:

Just so that I’m clear - you’re wanting an upsert action that makes no changes if the record already exists? TBH I’m not sure that there an equivalent behaviour.

Worst case scenario you can always implement a manual create action which performs an Ecto insert with the arguments you need.

We don’t have an on_conflict :nothing currently. I’m not sure what you mean about upsert_fields: []

upsert_fields: [] would be more equal to on_conflict: :raise since it will fail because it can’t change the resource attributes sent via the create action.

upsert_fields [] should cause it to, on an update, update nothing. Is that not what you want?