Merge b8aaac02aa into 93e66c90c4
This commit is contained in:
commit
c6fe085ae5
1 changed files with 15 additions and 13 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
(ns honeysql.helpers
|
(ns honeysql.helpers
|
||||||
|
#?(:cljs (:require-macros [honeysql.helpers :refer [defhelper]]))
|
||||||
(:refer-clojure :exclude [update]))
|
(:refer-clojure :exclude [update]))
|
||||||
|
|
||||||
(defmulti build-clause (fn [name & args]
|
(defmulti build-clause (fn [name & args]
|
||||||
|
|
@ -7,6 +8,7 @@
|
||||||
(defmethod build-clause :default [_ m & args]
|
(defmethod build-clause :default [_ m & args]
|
||||||
m)
|
m)
|
||||||
|
|
||||||
|
#?(:clj
|
||||||
(defmacro defhelper [helper arglist & more]
|
(defmacro defhelper [helper arglist & more]
|
||||||
(let [kw (keyword (name helper))]
|
(let [kw (keyword (name helper))]
|
||||||
`(do
|
`(do
|
||||||
|
|
@ -18,7 +20,7 @@
|
||||||
(build-clause ~kw m# args#)))
|
(build-clause ~kw m# args#)))
|
||||||
;; maintain the original arglist instead of getting
|
;; maintain the original arglist instead of getting
|
||||||
;; ([& args__6880__auto__])
|
;; ([& args__6880__auto__])
|
||||||
(alter-meta! assoc :arglists '(~arglist))))))
|
(alter-meta! assoc :arglists '(~arglist)))))))
|
||||||
|
|
||||||
(defn collify [x]
|
(defn collify [x]
|
||||||
(if (coll? x) x [x]))
|
(if (coll? x) x [x]))
|
||||||
Loading…
Reference in a new issue