Howdy! I've been strugling with translating this:
SELECT datetime(message.date / 1000000000 + strftime('%s','2001-01-01'),'unixepoch','localtime') AS d
into HoneySQL. I wonder if the https://cljdoc.org/d/com.github.seancorfield/honeysql/2.4.1045/doc/getting-started/sql-special-syntax-#raw directive is my only option?{:select [:%datetime.message/chat]}
is as far as I can getit's fairly simple actually.
{:select [[[:datetime [:+ [:/ :message.date 10] [:strftime :x "2001-01-01"]] "unixepoch", "localtime"] :d]]}Oh, so I just need to convert it to prefix-notation. Pretty clever. Not sure why I didn't get that from the docs. Maybe I just needed more examples. Thanks @raghavsharma
Yes. Just how you would do it in Clojure code. I've very rarely used the raw directive.
For the future, the #honeysql channel exists for library-specific questions. This channel #sql is intended for SQL itself, databases, and next.jdbc.