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.
This is the refactored version of #151, which addresses the hard-coded
id
primary key, and issues discussed in #6.The first two commits are the same as before, with merge conflicts resolved. The rest are to implement list actions and address some of what was discussed in the linked issue, hoping to make this change a less rough around the edges. 😃
The default serialization method remains unchanged from the old PR, but the separator was changed to
":"
, and an example on how the serialization could be done with ETF instead, for cases where the former method may introduce ambiguity, was added to the docs.For the list actions, I split the behavior as follows:
Records with a single primary key use the same query as before and should work exactly the same, just with the key itself being pulled from the schema.
List actions on records with a composite key use a dynamic query with an
or_where([pk1: val1, pk2: val2, ...])
clause per record. I don't love this solution, butwhere: ^composite_key in ^values
type of queries are not a thing (yet?), and I found no way to get around it withfragment
/dynamic
/field
/type
trickery.Happy to hear your thoughts!