honeysql 2024-05-15

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....

Have you tried searching for :composite on the HoneySQL docs website?

I did not know what I was looking for but now that I found it I can look!

@bkocin 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...