From bbe3b75bfd0767c61bcd436e843b9c785efd289f Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Mon, 19 Feb 2024 04:55:36 +0100 Subject: support `INSERT`, `DELETE`, `UPDATE` --- src/Store/Query/Record.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Store/Query/Record.hs') diff --git a/src/Store/Query/Record.hs b/src/Store/Query/Record.hs index b00be27..d663716 100644 --- a/src/Store/Query/Record.hs +++ b/src/Store/Query/Record.hs @@ -5,6 +5,7 @@ module Store.Query.Record lookup, Records, lookups, + union, disjointUnion, disjointUnions, ) @@ -52,6 +53,11 @@ lookups f rs = [v] -> Just v (_ : _) -> throw (DuplicateField (toString f)) +union :: J.Value -> J.Value -> J.Value +union (J.Object r) (J.Object s) = + J.Object (JM.unionWith union r s) +union _ s = s + disjointUnion :: J.Value -> J.Value -> J.Value disjointUnion (J.Object r) (J.Object s) = J.Object (JM.unionWithKey disjointUnion' r s) -- cgit v1.2.3