Open laurenceisla opened 1 week ago
Right now, UPSERTS done with POST requests ignore the filters in the query string, e.g:
curl -X POST "localhost:3000/single_unique?on_conflict=unique_key&unique_key=neq.1" \ -H "Content-Type: application/json" \ -H "Prefer: resolution=merge-duplicates" \ -H "Prefer: return=representation" \ -d '[{ "unique_key": 1, "value": "B" },{ "unique_key": 2, "value": "C" }]'
[{"unique_key":1,"value":"B"}, {"unique_key":2,"value":"C"}]
But we could make the filter behave like when doing an UPDATE through PATCH. So, unique_key=neq.1 would not be ignored and instead, it would be used in:
unique_key=neq.1
-- ... ON CONFLICT DO UPDATE ... WHERE <the filter goes here>
Then the previous request would return:
[{"unique_key":2,"value":"C"}]
Right now, UPSERTS done with POST requests ignore the filters in the query string, e.g:
But we could make the filter behave like when doing an UPDATE through PATCH. So,
unique_key=neq.1
would not be ignored and instead, it would be used in:Then the previous request would return: