This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-15
Channels
- # babashka (3)
- # beginners (28)
- # calva (8)
- # cider (16)
- # clj-on-windows (4)
- # clojure (69)
- # clojure-europe (29)
- # clojure-norway (42)
- # clojure-uk (4)
- # community-development (5)
- # conjure (3)
- # cursive (18)
- # datomic (68)
- # emacs (23)
- # events (1)
- # honeysql (7)
- # introduce-yourself (1)
- # jobs (1)
- # lsp (11)
- # music (1)
- # observability (3)
- # off-topic (35)
- # other-languages (33)
- # releases (1)
- # remote-jobs (2)
- # ring (18)
- # shadow-cljs (16)
- # timbre (5)
- # tools-deps (9)
I do not remember what the tuple comparison is called but is there a builtin way (wihtout using raw
) to do a 2-tuple comparison in a WHERE clause?
So for something like this
WHERE (time, uuid) > (val1, val2)
I have tried
[:raw (format "((time, uuid) > (%s, %s))" datetime uuid)]
But is there a better way?I see this is called a composite
and I can do something like
(hh/where [:> [:composite :col1 :col2] [value1 value2])
The value syntax is weird to me so if someone could explain that....I did not know what I was looking for but now that I found it I can look!
@U05NZDGDYG3 Is there something I can do to make this easier to find in the documentation?
FWIW, I went to the cljdoc documentation, and typed tuple
in the search box -- and this is the first result: https://cljdoc.org/d/com.github.seancorfield/honeysql/2.6.1126/doc/getting-started/general-reference#tuples-and-composite-values -- can I clarify how that section would apply to what you were trying to do?
I guess the real problem here was I did not know what I was looking for? I probably should have asked in a SQL chat to be honest. So that is my bad! Searching for "SQL tuple expressions" was not giving me the name "composite" so I did not know what to call it
I just used the word from your original question here to see if it was in the docs...