Skip to content

Commit

Permalink
Stop calling distinct on update args
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Walker committed Dec 17, 2018
1 parent b42690e commit 17645c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lighthouse/sql.clj
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
{:update-set (str "set " (->> (map (fn [[k _]] (str (-> k name snake-case) " = ?")) args)
(distinct)
(string/join ", ")))
:update-set-args (distinct (map second args))}))
:update-set-args (map second args)}))

(defn sql-part [db schema [k v]]
(condp = k
Expand Down Expand Up @@ -375,4 +375,4 @@
from-clause (or (:from m) (from-clause select-ks join-ks))
sql (->> (filter some? [select pull delete update update-set insert values from-clause joins where order offset limit group])
(string/join " "))]
(apply conj [sql] (concat (filter some? update-set-args) (filter some? args)))))
(apply conj [sql] (concat update-set-args (filter some? args)))))

0 comments on commit 17645c9

Please sign in to comment.