fix: handle results that can't be mapped to the changeset in bulk_create#638
Merged
zachdaniel merged 2 commits intomainfrom Oct 16, 2025
Conversation
c76f561 to
39499c6
Compare
zachdaniel
reviewed
Oct 15, 2025
| changeset.attributes | ||
| |> Map.take(keys) | ||
| cant_map_results_to_changesets = | ||
| any_generated_keys_missing?(keys, resource, changesets) |
Contributor
There was a problem hiding this comment.
but I don't see how this is possible? Don't we require the keys to be given to do an upsert on them? And this is only inside the upsert branch.
Contributor
Author
There was a problem hiding this comment.
This part happens regardless, there is another if further on top that we only enter on upserts
Contributor
There was a problem hiding this comment.
Oh, then we should switch back to index based when it's not an upsert. If it's just a create, either they are all created or not, there is no variability. Can you make that change?
If the identity used has attibutes that can be generated by the datalayer, we can't map the result back to the changeset and we need to just zip the results with the changesets and return them that way.
39499c6 to
522191c
Compare
zachdaniel
approved these changes
Oct 16, 2025
Contributor
|
🚀 Thank you for your contribution! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
should fix #637
Contributor checklist
Leave anything that you believe does not apply unchecked.