This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-04
Channels
- # architecture (20)
- # aws (8)
- # beginners (13)
- # boot (9)
- # cider (80)
- # cljs-dev (69)
- # cljsrn (7)
- # clojure (243)
- # clojure-dusseldorf (8)
- # clojure-italy (5)
- # clojure-norway (3)
- # clojure-poland (57)
- # clojure-russia (10)
- # clojure-shanghai (2)
- # clojure-spec (11)
- # clojure-uk (50)
- # clojurescript (198)
- # core-async (11)
- # crypto (2)
- # cursive (14)
- # datomic (17)
- # figwheel (8)
- # garden (7)
- # hoplon (8)
- # incanter (4)
- # jobs (1)
- # leiningen (1)
- # liberator (38)
- # lumo (28)
- # om (55)
- # onyx (10)
- # pedestal (13)
- # perun (20)
- # re-frame (1)
- # reagent (16)
- # ring-swagger (9)
- # spacemacs (11)
- # test-check (9)
- # unrepl (43)
- # untangled (163)
- # yada (8)
how does one usually store config values in datomic? lets say i need to define a margin value for a broad category of products. What is the most convienient way to do that with regards to easily manipulating that value, resetting it, and having only one instance of it per db ?
we have a ‘system’ entity on which we put global values
so you define a system entity that has know unique name
actually just a particular attr
so one can easily grab that anytine?
could you paste an example declaration and usage pattern? 🙂
i thinnk it would be easiest to understand the pattern
literally just :db/ident :system with a doc string and a bool type, and a function which finds the first entity with :system true
. all other code paths use that function. we manually transacted the entity’s creation
after that, it’s a normal entity with schema for whatever
ah i see. one could also slap a unique on that to always have enforced only one :system true …. and could also retrieve it by lookoup refs… correct?
gracias 😄
de nada!
and upserting works as well…. sweet 😄
I'm running into a strange error i can't really reason about. When I try to do a specific transaction, I get a stackoverflow error: https://gist.github.com/jdkealy/6a31372d05327c29df80c19a6180eac1 I have an attribute called user/org_touches ... which is cardinality = many. I have 2 user ids.... let's say 1 and 2 If i transact {:db/id 1 :user/org_touches [2] } it works fine, but if i do {:db/id 2 :user/org_touches [1] } it errors out with the above error