Hello! I've tried updating to the latest version of HoneySQL in Metabase and it appears that this commit https://github.com/seancorfield/honeysql/commit/a3ef21548520636168a970d780ff46a4be4fa002 breaks one of our tests. Metabase uses URL encoding to escape non-ASCII table names, so after the encoding the name may start with %. The linked commit replaced calling format-entity on the ddl names with format-var , and the latter treats the leading % as a function call.
(honey.sql/format {:create-table (java.net.URLEncoder/encode "привіт")})
=> ["CREATE TABLE D0%BF%D1%80%D0%B8%D0%B2%D1%96%D1%82()"]
;; The above is a malformed SQL.
I would change it in Metabase to ensure the slug never starts with % but doing so would be a breaking change to the users who already have DBs generated with the current encoding scheme.
I'm willing to fix this myself but I need guidance what is the best way to fix this in HoneySQL.Submitted an issue.
I believe this is fixed in the latest 2.6.9999-SNAPSHOT (a187ba98f129e263671da65da8b4ac22f08d70f4) so could folks try that version and make sure it doesn't break anything else? This was a regression introduced in https://github.com/seancorfield/honeysql/issues/526 when trying to fix as-is DDL with strings.
May I ask for a release that would include this fix, please?
Done. 2.6.1203. Should be up on Clojars in a few minutes.
Much appreciated!
Thank you for the quick fix! Indeed, the snapshot version passes all of the tests.