summaryrefslogtreecommitdiff
path: root/src/clojure_sql/compiler.clj
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@clearboxsystems.com.au>2013-07-06 13:55:49 +1000
committerCarlo Zancanaro <carlo@clearboxsystems.com.au>2013-07-06 13:55:49 +1000
commitd91170319be957b9202eaefd5153883d22ba6f38 (patch)
tree99577b1b1c1abb32b1bea003d1cdb8afb92e0f1e /src/clojure_sql/compiler.clj
parent6018063412cef2fa3895b04adb789fc43b9e3f40 (diff)
Make `sort` able to take expressions rather than just table names.
Diffstat (limited to 'src/clojure_sql/compiler.clj')
-rw-r--r--src/clojure_sql/compiler.clj4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/clojure_sql/compiler.clj b/src/clojure_sql/compiler.clj
index 8f72701..26b0d54 100644
--- a/src/clojure_sql/compiler.clj
+++ b/src/clojure_sql/compiler.clj
@@ -192,8 +192,8 @@
(defmulti compile-sort (fn [db _] db) :default :postgres)
(defmethod compile-sort :postgres [db fields]
(if fields
- (->> (for [[[table field] dir] fields]
- ($str (make-field-name db [table field])
+ (->> (for [[expr dir] fields]
+ ($str (compile-expression db expr) ;;(make-field-name db [table field])
(return (str \space (string/upper-case (name dir))))))
(apply sequence)
((p-lift string/join ","))