summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 ", ")))