Don't upper case function calls

To allow for case-sensitive function names
This commit is contained in:
David Powell 2013-04-12 19:11:33 +02:00
parent f13eeacff8
commit 90f3088c24

View file

@ -54,11 +54,10 @@
")"))
(defmethod fn-handler :default [op & args]
(let [op-upper (string/upper-case op)
args (map to-sql args)]
(let [args (map to-sql args)]
(if (infix-fns op)
(paren-wrap (string/join (str " " op-upper " ") args))
(str op-upper (paren-wrap (comma-join args))))))
(paren-wrap (string/join (str " " op " ") args))
(str op (paren-wrap (comma-join args))))))
(defmethod fn-handler "count-distinct" [_ & args]
(str "COUNT(DISTINCT " (comma-join (map to-sql args)) ")"))
@ -283,4 +282,4 @@
(str "LIMIT " (to-sql limit)))
(defmethod format-clause :offset [[_ offset] _]
(str "OFFSET " (to-sql offset)))
(str "OFFSET " (to-sql offset)))