From 9c6b9219eef5c197d920d094f762c8ae0a794de9 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 30 Sep 2013 01:26:39 +1000 Subject: Fix an example in the README, and add some expected generated SQL --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index e0cf7e7..2a283f7 100644 --- a/README.md +++ b/README.md @@ -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: -- cgit v1.2.3