`bulk_create` requiring `upsert_fields` with `upsert?: true`
Small conflict between the docs and usage of
bulk_create
:
Docs: "If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written."
https://hexdocs.pm/ash/Ash.Api.html#c:bulk_create/4
The error:
6 Replies
GitHub
ash/bulk.ex at c174713b70798e465838e77420fb51b70f36ea67 · ash-proje...
A declarative and extensible framework for building Elixir applications. - ash/bulk.ex at c174713b70798e465838e77420fb51b70f36ea67 · ash-project/ash
Thanks for the report! Mind opening an issue on the repo? I’ll get it changed. A PR to the docs would also be great 🙂
I can PR the docs, but it's there something in the way of us adding the requisite behavior? Haven't had time to dig.
Nope, it’s a mistake copying from the create action. I don’t think that we can currently support that behavior with bulk upserts.
GitHub
docs:
bulk_create
does not support automatic upsert_fields
by b...Contributor checklist
Bug fixes include regression tests
Chores
Documentation changes
Features include unit/acceptance tests
Refactoring
Update dependencies
Not gonna pass CI with the credo/unit stuff