This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-19
Channels
- # aleph (8)
- # announcements (43)
- # babashka (43)
- # beginners (62)
- # calva (8)
- # cider (27)
- # clj-kondo (18)
- # cljs-dev (25)
- # cljsrn (16)
- # clojure (51)
- # clojure-europe (6)
- # clojure-nl (14)
- # clojure-spec (7)
- # clojure-uk (39)
- # clojurescript (17)
- # cursive (9)
- # datascript (12)
- # datomic (16)
- # events (1)
- # fulcro (7)
- # funcool (1)
- # graalvm (2)
- # graphql (5)
- # jobs (1)
- # juxt (6)
- # kaocha (9)
- # leiningen (11)
- # luminus (1)
- # malli (1)
- # off-topic (80)
- # other-languages (2)
- # overtone (3)
- # pedestal (5)
- # quil (1)
- # re-frame (6)
- # reagent (1)
- # reitit (4)
- # rewrite-clj (5)
- # shadow-cljs (207)
- # spacemacs (1)
- # specter (4)
- # sql (1)
- # vim (14)
- # xtdb (7)
how can i access the result of a built-in transaction function like :db/retractEntity
so i can modify it?
i would need to replace some of the retractions with assertions containing new computed values
answering my question:
(->> :db/retractEntity (d/entity db) d/touch :db/code)
reveals how it works:
=> "(clojure.core/fn [db e] (datomic.builtins/build-retract-args db e))"
and indeed it works:
(datomic.builtins/build-retract-args db :x)
=> [[2 17592186045418 10 :x]]
however, since it's not documented anywhere, im bit hesitant to use it 😕Datomic forum is down
seems operational to me?
I also saw it was down, back up for me too
Still down for me
not sure why this isn't on the datomic site (at least that I could see), or why there's no testing page in general, but this is super useful: https://www.youtube.com/watch?v=JaZ1Tm6ixCY
hmm, not as useful as I thought - it looks like a db created from the datomic.api
ns cannot be passed to (d/q)
in datomic.client.api
..
(shrug) will just do this then:
(defn get-user-settings*
([db username]
(get-user-settings* d/q db username)) ;; <-- this is datomic.client.api
([q db username] ;; <-- in tests pass in datomic.api/q
(->> (q query-all-settings db username)
xform-user-settings)))
someone wrote a lib for testing datomic.client.api
with an in-mem DB; I think it’s this: https://github.com/ComputeSoftware/datomic-client-memdb