I’m trying to write a CTE and force it to be materialized (psql) The sql would look like: with cte as materialized (select * from stuff) Any pointers how i can get it done in honeysql?
Doesn't seem to be documented, but after looking at the source it seems that this is how you do it:
(sql/format {:with [[:cte {:select :* :from :stuff} :materialized]]})
=> ["WITH cte AS MATERIALIZED (SELECT * FROM stuff)"]Works! Thank you 🙂
It was added in this PR but never made it into the docs https://github.com/seancorfield/honeysql/pull/420/files -- if either of you feel inclined to create an issue about it, so I don't forget, or even a PR against the docs, I'd appreciate that!
I’ll take a crack at the docs tomorrow 👍