diff options
-rw-r--r-- | src/clojure_sql/dsl.clj | 4 | ||||
-rw-r--r-- | test/clojure_sql/core_test.clj | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/clojure_sql/dsl.clj b/src/clojure_sql/dsl.clj index 996b55c..8c9c31d 100644 --- a/src/clojure_sql/dsl.clj +++ b/src/clojure_sql/dsl.clj @@ -45,8 +45,8 @@ (ambiguous-error field))))) (defn ^:private resolve-fields [table aliases expression] - (cond (list? expression) (map (partial table aliases) expression) - (vector? expression) (mapv (partial table aliases) expression) + (cond (list? expression) (map (partial resolve-fields table aliases) expression) + (vector? expression) (mapv (partial resolve-fields table aliases) expression) (keyword? expression) (resolve-field table aliases expression) :else expression)) diff --git a/test/clojure_sql/core_test.clj b/test/clojure_sql/core_test.clj index b5d65e7..236e421 100644 --- a/test/clojure_sql/core_test.clj +++ b/test/clojure_sql/core_test.clj @@ -18,8 +18,13 @@ (into {} (-> (table :user) (project '{(+ :username :password) :u}))) -(-> (table {(-> (table :users) - (project '[:username (+ 1 2 3)]) - (rename '{(+ 1 2 3) :x}) - (select `(exists ~(table :users)))) :u}) +(-> (table :users) + (project '[:username (+ 1 2 3)]) + (rename '{(+ 1 2 3) :x}) + (select `(exists ~(-> (table :users) + (select '(= 10 :username))))) println) + +(-> (table :users) + (project {:username :un}) + (select '(= :username 10))) |