honeysql

Discussion of https://github.com/seancorfield/honeysql :slightly_smiling_face:
2021-05-14T09:45:27.305100Z

Can you express nested functions in honeysql, say sum(coalesce(a, b))?

2021-05-14T15:47:37.306400Z

Would [:sum [:coalesce a b]] work?

seancorfield 2021-05-14T16:23:51.306600Z

dev=> (sql/format-expr [:sum [:coalesce :a :b]])
["SUM(COALESCE(a, b))"]
dev=> (sql/format {:select [ [[:sum [:coalesce :a :b]] :c] ]})
["SELECT SUM(COALESCE(a, b)) AS c"]
dev=> 

2💯