I seem to be doing something weird with 0.9.1/master where the test case for insert-into passes (using honeysql.format/format-clause) but inserts an extra set of parens when called with honeysql.core/format
the third insert-into-test here: https://github.com/jkk/honeysql/blob/master/test/honeysql/format_test.cljc#L60 passes for me, but the same map has an extra set of parens around the SELECT (as though we didn't set *subquery?*
to be false) when built with honeysql.core/format
user=> (honeysql.core/format {:insert-into [[:foo [:a :b :c]] {:select [:d :e :f] :from [:baz]}]})
["INSERT INTO foo (a, b, c) (SELECT d, e, f FROM baz)"]
user=> (honeysql.format/format-clause (first {:insert-into [[:foo [:a :b :c]] {:select [:d :e :f] :from [:baz]}]}) nil)
"INSERT INTO foo (a, b, c) SELECT d, e, f FROM baz"
it appears that patching https://github.com/jkk/honeysql/blob/master/src/honeysql/format.cljc#L543 to wrap with a
(binding [*subquery?* false] ...)
gets honeysql.core/format to behave the same as honeysql.format/format-clausefixed in this PR: https://github.com/jkk/honeysql/pull/196/files