diff options
author | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-07-12 10:20:45 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-07-12 10:20:45 +1000 |
commit | 570d86b1bfa4099a6af5c71a733f622fbf49f959 (patch) | |
tree | 3cec1aeb5cd5291623018411004c2de5a6417b5b | |
parent | c2c3e896dcd69ef59132395126bd2e8fe13434a2 (diff) |
Expose a few more helper functions in clojure-sql.core
-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))) |