This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-03
Channels
- # announcements (1)
- # asami (13)
- # babashka (14)
- # beginners (58)
- # calva (49)
- # cljs-dev (6)
- # clojure (99)
- # clojure-europe (28)
- # clojure-gamedev (4)
- # clojure-nl (19)
- # clojure-spec (4)
- # clojure-uk (39)
- # clojured (5)
- # clojurescript (39)
- # code-reviews (3)
- # conjure (4)
- # cryogen (12)
- # cursive (21)
- # data-science (4)
- # datalog (1)
- # datomic (16)
- # duct (4)
- # events (1)
- # fulcro (6)
- # graalvm (1)
- # graphql (1)
- # jobs (13)
- # jobs-discuss (23)
- # kaocha (2)
- # lsp (15)
- # malli (24)
- # missionary (6)
- # off-topic (21)
- # polylith (75)
- # releases (2)
- # remote-jobs (4)
- # shadow-cljs (47)
- # sql (35)
- # vim (10)
- # xtdb (4)
@favila Thanks for the tip!
Hi š
In Datomic Cloud, what is the recommended way of getting a sorted result set from a query?
Two variations on the theme that Iām interested in would be sorted by transaction :db/txInstant
or sorted by arbitrary attribute on the entity.
index-pull if there is one :avet or cardinality-many :aevt index that matches your results and desired order
I just want to double check, beyond :db/cas
and transaction functions, which must be installed, there's no way to ensure a state before transacting, no?
@U09QBCNBY What kind of guarantees are you looking for?
I want to ensure that no other transactions have touched the target datoms entity before committing the transaction. I would use cas, however I need to read one attribute and then set another, sadly.
this is an ad hoc thing, otherwise we would just install a transaction function that could throw if the constraints weren't matched
{:tx-data [[:db/cas 42 :no/touchy 100 100] [:db/add 9000 :iff/no-touchy-cas "winning?"]]}
AH HA! I just leave the cas'd value the same -- I didn't realize that a single cas would cancel the entire transaction. That's great!!
Haha, no way @U09QBCNBY I love your questions!!