This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-29
Channels
- # babashka (30)
- # beginners (207)
- # biff (3)
- # calva (10)
- # cljs-dev (3)
- # clojure (34)
- # clojure-austin (3)
- # clojure-bay-area (1)
- # clojure-dev (3)
- # clojure-europe (31)
- # clojure-nl (1)
- # clojure-norway (37)
- # clojure-uk (8)
- # community-development (3)
- # core-async (4)
- # data-science (1)
- # dev-tooling (2)
- # emacs (4)
- # etaoin (12)
- # fulcro (7)
- # gratitude (1)
- # hyperfiddle (7)
- # jobs-discuss (191)
- # lsp (15)
- # malli (1)
- # other-languages (11)
- # overtone (1)
- # pathom (3)
- # pedestal (1)
- # polylith (21)
- # releases (1)
- # squint (5)
- # yamlscript (5)
I'm seeing weird behavior with Datomic's query:
(e/server
(let [db (ee/watch-db db-conn)
x (dm/q
'[:find ?e .
:where [?e :db/ident]]
db)]
(log/info :VAR x)
(log/info :EXPR (dm/q
'[:find ?e .
:where [?e :db/ident]]
db))))
Whenever db
changes, I'd see only :EXPR logged. This also happens if I substitute dm/q
with dm/entity
or dm/pull
. Other operations such as dm/datoms
produce expected result (with :VAR logged). What is going on?if x
results to the same value as it was before electric won't re-run the :VAR
log call since the arguments to it didn't change. Can that be the case here?
❤️ 1
Oh silly me. Yes that's it. Thank you.
Looks like it's not the case for the original problem I'm struggling with:
(e/server
(log/info :arg state/db uid)
(let [x (some? (seq (d/entity state/db uid)))]
(log/info :VAR x)
(log/info :EXPR (some? (seq (d/entity state/db uid))))))
Here I make some transaction and got the following logs:
:arg datomic.db.Db@4d9e0613 17592186201160
:VAR true
:EXPR true
;; after tx
:arg datomic.db.Db@add94f9 17592186201160
:EXPR false
Do you have any idea?