diff options
-rw-r--r-- | src/clojure_sql/core.clj | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/clojure_sql/core.clj b/src/clojure_sql/core.clj index 4a55c3a..01e128d 100644 --- a/src/clojure_sql/core.clj +++ b/src/clojure_sql/core.clj @@ -18,9 +18,11 @@ (pull clojure-sql.dsl table join project rename + prefix-names-matching prefix-names as-subobject select group having - sort take drop) + sort take drop + union intersection) (def ^:private ^:dynamic *database-type* nil) @@ -78,3 +80,11 @@ (*query-executor* :delete compiled))) (q/set-query-deref-behaviour! run-query) + +(let [users (-> (table :users) + (project [:id :email])) + people (-> (table :people) + (project [:id :name]))] + (join (rename users (as-subobject :user)) + (rename people (as-subobject :person)) + :on `(= :user.id :person.id))) |