diff options
author | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-07-01 09:54:02 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-07-01 09:54:02 +1000 |
commit | dd262c012993ea7033607379b06968a279efa1f3 (patch) | |
tree | 853d47e31695b605601b479eccb9e1980b76a917 | |
parent | 4d69593b6038d3df035aae0bd278103a56ec6500 (diff) |
Make fields compile in a deterministic order (necessary for union stuff)
-rw-r--r-- | src/clojure_sql/compiler.clj | 2 |
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 ", "))) |