This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-02
Channels
- # announcements (2)
- # babashka (9)
- # calva (8)
- # cider (2)
- # clj-kondo (3)
- # clojure (113)
- # clojure-austin (1)
- # clojure-dev (27)
- # clojure-europe (11)
- # clojure-germany (2)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-norway (18)
- # clojure-uk (32)
- # clojuredesign-podcast (4)
- # core-async (16)
- # core-typed (45)
- # cursive (5)
- # data-science (1)
- # datomic (7)
- # events (1)
- # gratitude (2)
- # hugsql (1)
- # hyperfiddle (7)
- # integrant (4)
- # keechma (10)
- # leiningen (4)
- # malli (1)
- # missionary (14)
- # off-topic (62)
- # onyx (8)
- # other-languages (21)
- # pathom (1)
- # reitit (4)
- # releases (2)
- # shadow-cljs (35)
- # squint (1)
- # transit (1)
Hello everyone 👋 What would you say the best way to mimic a flexible map type in attribute for insertion and query purposes? Insertion - I'd like to be able to insert a map to the attribute, when overlapping keys values will be overrided (not newly created) query - I'd like to be able to pull the entire map without specifing each key
not quite sure what a map to the attribute is referring to, but in Datomic that would more commonly be a ref
to another entity instead of a serialized map
We want to have "dynamic" keys. So we did a ref to an entity that hold a "key" and a "value" and tried to use unique/identity on the "key" attribute + parent-id to get it to not create the same key twice for the same parent and override the value, but unique/identity doesn't do an upsert on a tuple type but just throws a unique constraint violation.
Possibly cardinality-many heterogenous tuple of key + value with insertions and deletions managed by transaction functions, and an entity predicate to ensure key uniqueness for good measure. If tuple is too limiting of value type, could use entities instead for each map entry