Hello! How do I translate the following SQL to honey? I have not managed to find any solution in the docs.
FROM table, lateral jsonb_to_recordset(columns) as col(key text, "dataType" text, label text)
I am currently cheating with :raw :
(hh/from :table [(hh/lateral [:jsonb_to_recordset :columns]) [[:'col [:raw "key text"] [:raw "\"dataType\" text"] [:raw "label text"]]]])
🙏Ok, thx! -> https://github.com/seancorfield/honeysql/issues/557
user=> (sql/format {:select :* :from [[[:json_to_recordset :my-json-column] [:b {:with-columns [[:c :int] [:d :text]]}]]]})
["SELECT * FROM JSON_TO_RECORDSET(my_json_column) AS b (c INT, d TEXT)"]I don't think there's a way to specify column types in a composite like that. Feel free to create a GH issue with links to the relevant parts of the PostgreSQL docs so I can see the full extent of the syntax I need to support.