Postgres already has a way to do "upsert" but I don't like sending these long queries, I wonder if it could be implemented as a stored procedure which would accept json and perform
INSERT INTO ... (keys) VALUES (values) ON CONFLICT DO UPDATE SET (setEverythingFromExcluded)
I know I could somehow use
json_extract_path or maybe directly
json_each but my initial attempts lead nowhere so maybe somebody already did this?