summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md6
1 files changed, 5 insertions, 1 deletions
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: