Partial document update based on JSON Patch #3166
Labels
difficulty: medium
Haskell task involving PostgreSQL IO
enhancement
a feature, ready for implementation
Problem
Currently there's no way to do a partial document update.
set.
filter forPATCH
#465 (comment) discusses json patch but there are certain operations (liketest
) which don't make much sense given our horizontal filtering.set.
filter forPATCH
#465 (comment), but it's flexibility makes it harder to implement. Additionally it's not isolated to a single content type.Solution
Use a vendored media type based on json patch where we support the operations we lack. As prior art, azure cosmosdb json patch (also see here) does a similar thing and adds support for
increment
andset
, which are not defined in the JSON Patch RFC.For starters, we can add support for increment. Like so:
Path would refer to any column and the generated SQL would be like
UPDATE items SET inventory = inventory + 10
.Later on we can extend this to add other operations, like
mult
,div
,concat
, etc.The text was updated successfully, but these errors were encountered: