This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-10
Channels
- # announcements (3)
- # asami (4)
- # babashka (21)
- # beginners (97)
- # calva (32)
- # cider (4)
- # clj-kondo (7)
- # cljdoc (1)
- # clojure (70)
- # clojure-europe (27)
- # clojure-nl (10)
- # clojure-norway (18)
- # clojure-uk (8)
- # clojure-ukraine (1)
- # clojurescript (5)
- # datalevin (7)
- # docker (1)
- # emacs (3)
- # fulcro (4)
- # girouette (4)
- # graalvm (2)
- # graphql (9)
- # gratitude (3)
- # honeysql (4)
- # hoplon (3)
- # hyperfiddle (7)
- # jobs (3)
- # kaocha (31)
- # lsp (23)
- # malli (7)
- # missionary (6)
- # nextjournal (9)
- # off-topic (6)
- # pathom (13)
- # polylith (13)
- # practicalli (3)
- # remote-jobs (3)
- # reveal (7)
- # schema (1)
- # sci (23)
- # shadow-cljs (31)
- # tools-deps (62)
- # xtdb (8)
How can I make the equivalent of a left outer group by join in xtdb?
'{:find [d1 (sum du)]
:where [
[d1 :type :deliverable]
[tc :type :timecard]
[tc :duration du]
[tc :deliverable d1]
]}
If there’s no timecard for a deliverable, the deliverable isn’t returned in this query. I’d like for it to be returned (and the sum be zero) even if there’s no timecard. Any way to do this without resorting to an n+1
query?Hey @UAEFFG05B I'll dig into this shortly, but on first glance it looks remarkably similar to the very last thread in this channel, so maybe there's some clues there 🙂 see https://clojurians.slack.com/archives/CG3AM2F7V/p1646912505901429?thread_ts=1646671389.384489&cid=CG3AM2F7V
🙂 1
kind of n+1 (not recursive, at least), but it's all happening in-process so it shouldn't be a performance concern 🙂
(or-join [du d1]
(and [tc :type :timecard]
[tc :duration du]
[tc :deliverable d1])
(and [(identity 0) du]
[d1 :type :deliverable])
)
seems to work, thanks @U899JBRPF🙌 1