From dd262c012993ea7033607379b06968a279efa1f3 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 1 Jul 2013 09:54:02 +1000 Subject: Make fields compile in a deterministic order (necessary for union stuff) --- src/clojure_sql/compiler.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ", "))) -- cgit v1.2.3