From 570d86b1bfa4099a6af5c71a733f622fbf49f959 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Fri, 12 Jul 2013 10:20:45 +1000 Subject: Expose a few more helper functions in clojure-sql.core --- src/clojure_sql/core.clj | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/clojure_sql') 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))) -- cgit v1.2.3