honeysql

2025-12-09T23:09:48.998269Z

How might I add an AS MATERIALIZED hint to a CTE with honeysql?

p-himik 2025-12-09T23:12:38.308919Z

Documented here: https://cljdoc.org/d/com.github.seancorfield/honeysql/2.7.1310/doc/getting-started/sql-clause-reference?q=materialized#with-with-recursive

(honey.sql/format {:with [[:stuff {:select :*
                                   :from :table} :materialized]]
                   :select :*
                   :from :stuff})
=> ["WITH stuff AS MATERIALIZED (SELECT * FROM table) SELECT * FROM stuff"]

🙏 1