This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-21
Channels
- # announcements (1)
- # babashka (66)
- # beginners (37)
- # calva (3)
- # cljdoc (2)
- # clojure (14)
- # clojure-australia (6)
- # clojure-doc (4)
- # clojure-europe (22)
- # clojurescript (9)
- # datalevin (5)
- # datomic (4)
- # emacs (5)
- # events (1)
- # figwheel-main (6)
- # graalvm (41)
- # lsp (16)
- # luminus (1)
- # off-topic (2)
- # overtone (2)
- # re-frame (2)
- # reagent (8)
- # remote-jobs (1)
- # reveal (49)
- # shadow-cljs (9)
- # spacemacs (14)
- # tools-build (4)
- # tools-deps (16)
(let [already? (into
#{}
cat
(d/qseq
'[:find ?key
:where
[_ :airstats.jira.ticket/key ?key]]
(d/db @conn)))])
(defn already?
[db key]
(d/pull
db
'[:db/id]
[:airstats.jira.ticket/key key]))
which is better?
the use case is to check if some ticket key is already in the db. So I don't assert it twiceIf you make the ticket key unique asserting twice will not work (or work as an upsert). The advantage of that is that it's atomic :)
https://docs.datomic.com/cloud/best.html#set-txinstant-on-imports what does it mean for txInstant to be newer than the transactors clock time? The second sentence seems to imply I shouldn't choose dates from the future else it needs to catch up.. ?