This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-28
Channels
- # aws (1)
- # babashka (113)
- # beginners (41)
- # cider (9)
- # cljdoc (15)
- # cljs-dev (8)
- # cljsrn (5)
- # clojure (113)
- # clojure-australia (4)
- # clojure-europe (40)
- # clojure-nl (8)
- # clojure-taiwan (1)
- # clojure-uk (60)
- # clojurescript (59)
- # code-reviews (2)
- # conjure (1)
- # datahike (12)
- # events (1)
- # jobs (1)
- # kaocha (4)
- # lsp (24)
- # luminus (19)
- # malli (4)
- # off-topic (28)
- # pathom (10)
- # philosophy (1)
- # portal (6)
- # re-frame (3)
- # reagent (9)
- # remote-jobs (1)
- # shadow-cljs (31)
- # sql (24)
- # tools-deps (6)
- # xtdb (14)
Is there a way I can use malli to generate datomic schema?
not ‘out of the box’ per se but it’s pretty straight forward. depends on the way you define your schemas. We use the dynamic registry sort of like spec, so our attributes are first class which sort naturally maps to datomic, and then just map over the registry for our attrs, :{db/ident <attr> :db/valueType (malli-to-datomic …) …}
theres of course specific stuff you’ll probably do for enums :my/enum [:enum :a :b]
becomes norms for a :my/enum
ref and :my.enum/a
, etc. :map’s to refs, etc. We have our own custom options for additional customization when we generate.
also, this video talks about this in general in terms of using malli to drive a lot of the rest of your app. https://www.youtube.com/watch?v=ww9yR_rbgQs&t=696s