diff options
Diffstat (limited to 'src/clojure_sql')
-rw-r--r-- | src/clojure_sql/compiler.clj | 4 | ||||
-rw-r--r-- | src/clojure_sql/dsl.clj | 4 |
2 files changed, 4 insertions, 4 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 ",")) diff --git a/src/clojure_sql/dsl.clj b/src/clojure_sql/dsl.clj index c94f678..35f296f 100644 --- a/src/clojure_sql/dsl.clj +++ b/src/clojure_sql/dsl.clj @@ -311,8 +311,8 @@ (assoc query :sort (for [field fields-seq] (if (vector? field) - [(resolve-field table-name fields-lookup (first field)) (second field)] - [(resolve-field table-name fields-lookup field) :asc]))))) + [(process-expression table-name fields-lookup (first field)) (second field)] + [(process-expression table-name fields-lookup field) :asc]))))) (defn group "Apply a grouping to a query. |