honeysql 2023-08-29

Not sure if there is a way in HoneySQL to write:

SELECT date AT TIME ZONE 'Europe/London', ...

Nothing built-in but you can always use :raw or add your own formatter.

Yeah, I'm doing

(str (sql/format-entity :bank-transaction/date)
     " AT TIME ZONE "
     \' dates/*default-zone-id* \')

...into a :raw

Yeah, that works. But you also don't need to call str, you can just use [:raw "str1" " str2 " "str3"]. Note the spaces though since :raw doesn't add them for you.

But if you use AT TIME ZONE more than once, I'd recommend adding your own formatter/function/whatever might be more suitable. It's all well documented.

👍 1
1

Seems like this is fairly widely-supported SQL so I'll add it to core https://github.com/seancorfield/honeysql/issues/503 Looks like this is widely-enough supported that it ought to be in the core. Can you create a GitHub issue

👍 2