honeysql 2026-02-18

I'm trying to recreate this statement

SELECT DISTINCT col_name COLLATE latin1_bin FROM X
as found from https://stackoverflow.com/questions/19462919/mysql-select-distinct-should-be-case-sensitive (unrelated, TIL that mysql distinct is case-insensitive by default) I feel like this should work:
(h/format
  {:select [[[:distinct :col_name :!collate-latin1_bin]]]
   :from :x})
but it elides the COLLATE latin1_bin, I'm guessing because :distinct is considered as "special syntax" rather than a function call edit: I've resorted to using :call to get around it
(h/format
  {:select [[[:call :distinct :col_name :!collate-latin1_bin]]]
   :from :x})

That produces SELECT DISTINCT(col_name COLLATE LATIN1_BIN) FROM x -- you're okay with the ( ) there?

Feel free to create an issue for expanding the [:distinct ..] special syntax to support collation etc.