This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-21
Channels
- # announcements (11)
- # architecture (8)
- # aws (7)
- # babashka (1)
- # beginners (55)
- # calva (52)
- # cider (4)
- # clj-kondo (5)
- # clojure (12)
- # clojure-europe (7)
- # clojure-uk (3)
- # clojurescript (40)
- # clr (1)
- # conjure (5)
- # data-oriented-programming (7)
- # datomic (8)
- # emacs (3)
- # events (1)
- # graphql (2)
- # honeysql (5)
- # lsp (7)
- # missionary (24)
- # nbb (10)
- # off-topic (12)
- # pathom (5)
- # reagent (9)
- # reitit (4)
- # schema (1)
- # sci (9)
- # shadow-cljs (2)
- # specter (6)
- # tools-deps (4)
- # xtdb (13)
Hi i need to query an attribute of the document on two different valid-times and output it at once any examples of such a query?
hey @UH16CGZC2 👋 XT only does single-point-in-time queries, so I'd recommend making two queries at the two different valid-times and combining them in your application
You can embed other history calls and queries inside a top-level query, if that might be of use: https://gist.github.com/refset/8439ceebf3c1f08c614b0c818266a140
It looks like you could cut out 3 of the clauses using pull
, yep:
:find [(pull ?clan [:clan/name]) (pull ?profile [:profile/name :profile/rank]) ?cbw-old ?cbw ?cbw-diff]
I guess the more Datalog you write the more you get used to it, and the simpler it ends up looking...
is it possible to add something else to a join when building nested results using pull, like ?cid
(q '{:find [(pull ?clan [:clan/name {:clan/members [:profile/name [?cid :as :cid]]}])]
:where [[?clan :clan/name "..."]
[?clan :xt/id ?cid]]})
expected output
#{[{:clan/name "..."
:clan/members [{:profile/name "..."
:cid "..."}
{...}]}]}