From 54b620d0f9e101bfb5ab78b2cf14813af4db6cec Mon Sep 17 00:00:00 2001 From: madvas Date: Wed, 29 Nov 2017 19:41:35 +0100 Subject: [PATCH] Fix #193 --- src/honeysql/format.cljc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/honeysql/format.cljc b/src/honeysql/format.cljc index 2f3766f..436a0b4 100644 --- a/src/honeysql/format.cljc +++ b/src/honeysql/format.cljc @@ -43,6 +43,8 @@ (def ^:dynamic *allow-dashed-names?* false) +(def ^:dynamic *name-transform-fn* nil) + (def ^:private quote-fns {:ansi #(str \" (string/replace % "\"" "\"\"") \") :mysql #(str \` (string/replace % "`" "``") \`) @@ -61,7 +63,10 @@ (string/replace s "-" "_")) (defn quote-identifier [x & {:keys [style split] :or {split true}}] - (let [name-transform-fn (if *allow-dashed-names?* identity undasherize) + (let [name-transform-fn (cond + *name-transform-fn* *name-transform-fn* + *allow-dashed-names?* identity + :else undasherize) qf (if style (quote-fns style) *quote-identifier-fn*)