summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@clearboxsystems.com.au>2013-07-01 09:54:02 +1000
committerCarlo Zancanaro <carlo@clearboxsystems.com.au>2013-07-01 09:54:02 +1000
commitdd262c012993ea7033607379b06968a279efa1f3 (patch)
tree853d47e31695b605601b479eccb9e1980b76a917 /src
parent4d69593b6038d3df035aae0bd278103a56ec6500 (diff)
Make fields compile in a deterministic order (necessary for union stuff)
Diffstat (limited to 'src')
-rw-r--r--src/clojure_sql/compiler.clj2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/clojure_sql/compiler.clj b/src/clojure_sql/compiler.clj
index d0b1206..8f72701 100644
--- a/src/clojure_sql/compiler.clj
+++ b/src/clojure_sql/compiler.clj
@@ -147,7 +147,7 @@
(defmulti compile-fields (fn [db _] db) :default :postgres)
(defmethod compile-fields :postgres [db fields-map]
(if (seq fields-map)
- (->> (for [[alias field] fields-map]
+ (->> (for [[alias field] (sort-by first fields-map)]
(make-field-name db field alias))
(apply sequence)
((p-lift string/join ", ")))