This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-04
Channels
- # architecture (9)
- # babashka (33)
- # beginners (53)
- # biff (3)
- # cljdoc (11)
- # clojure (8)
- # clojure-austria (2)
- # clojure-dev (9)
- # clojure-europe (64)
- # clojure-nl (2)
- # clojure-norway (49)
- # clojure-sweden (4)
- # clojure-uk (4)
- # clojurescript (16)
- # cursive (14)
- # datahike (31)
- # datalevin (6)
- # datascript (9)
- # events (1)
- # fulcro (4)
- # honeysql (8)
- # hyperfiddle (116)
- # introduce-yourself (1)
- # kaocha (2)
- # malli (13)
- # nyc (2)
- # off-topic (4)
- # polylith (5)
- # portal (1)
- # reagent (1)
- # reitit (18)
- # releases (1)
- # spacemacs (6)
malli mentioned in this blog: https://kevinlynagh.com/newsletter/2023_09_hardware_prototyping/
Yeah I was reading it, thinking “Malli fits this usecase super well” then shocked to see it mentioned directly 😂
How can I define a Datomic Ref as a malli schema?
Hmm, I’m building set of scrapers for the same domain, but I get the data from different sources. Every scraper implementation has to satisfy a certain protocol, so then I can transact the results adapted to the unified model. I would like to provide a schema for this edge of the system to make sure I’m not transacting 💩. However, I’m not sure how the ref should be defined here. I wanted to use something like: [:some.diatomic/attribute [:or TFullEntity TDatomicRef]] Is there some predicate in the datomic API, so that I can check if the attribute is indeed a ref?
It seems ref is just a number. Thought it’s some sort of a Ref type that is shown as a number. I will define it as a number? then ;)
ah ok. we use uuids for all entities with a standard key and always using idents for refs. that way it’s easy to create a schema because every ref is [k uuid]
does that work for you? having uuids is generally a good idea for datomic entities in case you ever want to export/import
Hmm, this will not work for me. I'm not having uuids, but composite tuples since I'm not in control of the source of the data and for composite tuples I need to resolve the entity-ids 😄
Thank you so much for help @U0510KXTU!