diff options
author | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-09-30 01:26:39 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-09-30 01:26:39 +1000 |
commit | 9c6b9219eef5c197d920d094f762c8ae0a794de9 (patch) | |
tree | 207afb1e96eaf1b7ab726dd5a3b99623361ab6e8 | |
parent | e77814f7d117f9f5315d65a48a854e0128111bfc (diff) |
Fix an example in the README, and add some expected generated SQL
-rw-r--r-- | README.md | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -122,10 +122,14 @@ The primary operations available in `clojure-sql` are the following: :::clojure (s/join (-> (s/table :users) - (s/project [:id :username :person,id])) + (s/project {:id :id, :username :username, :person :person.id})) (-> (s/table :people) (s/project [:id :name]) (s/rename (s/as-subobject :person)))) + ;; => ["SELECT \"users2834\".\"id\" AS \"id\", \"users2834\".\"person\" AS \"person.id\", + \"table2836\".\"name\" AS \"person.name\", \"users2834\".\"username\" AS \"username\" + FROM (\"users\" AS \"users2834\" INNER JOIN \"people\" AS \"table2836\" + ON (\"users2834\".\"person\" = \"table2836\".\"id\"))"] With joins the composability of `clojure-sql` becomes much more useful: |