This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-01
Channels
- # babashka (2)
- # beginners (51)
- # calva (79)
- # cestmeetup (1)
- # chlorine-clover (1)
- # cider (6)
- # clj-kondo (1)
- # cljdoc (4)
- # cljsrn (2)
- # clojure (31)
- # clojure-europe (2)
- # clojurescript (5)
- # conjure (4)
- # cursive (26)
- # datascript (4)
- # datomic (1)
- # figwheel (1)
- # figwheel-main (2)
- # off-topic (25)
- # reagent (2)
- # reveal (4)
- # shadow-cljs (21)
- # xtdb (1)
What exactly counts as an entity in Datomic? Is it whatever datoms are transacted together as part of a single transaction form?
I’m asking bc I’m pondering what would be the best way to model a belongs-to relationships of different namespaced datoms that are always created together?
e.g. an account
and a user
should they be transacted* together as a single db entity?
{:tx-data [{:account/username "admin"
:user/email ""}]}
or would it be better to make them separate db entities and give one a db ref to the other?
{:tx-data [{:account/username "admin"}
{:user/email ""
:user/account [:account/username "admin"]}
i imagine making them a single db entity and adding a db ref would redundant since the datom would be referencing its own db id
{:tx-data [{:account/username "admin"
:user/email ""
:user/account [:account/username "admin"]}