From 8a436b230b8357eaed6fc59c6fdbeb86295e12f7 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Sun, 23 Jun 2013 01:12:36 +1000 Subject: Fix the README examples. --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b83479e..9a90ee2 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ queries to be entirely special-cased per database. By default (-> (s/table :users) ;; tables are automatically given internal aliases (s/project [:id :username])) - ; => ["SELECT \"users1234\".\"id\", \"users1234\".\"username\" FROM \"users\" AS \"users1234\""] + ;; => ["SELECT \"users3205\".\"id\" AS \"id\", \"users3205\".\"username\" AS \"username\" FROM \"users\" AS \"users3205\""] (-> (s/table :users) (s/project [:id :username]) @@ -36,11 +36,9 @@ queries to be entirely special-cased per database. By default (s/join (-> (s/table :people) (s/project {:id :pid, :fname :first}) (s/select '(= :first "Henry"))) - '(= :uid :pid)) + :on '(= :uid :pid)) (s/project [:username])) - ; => ["SELECT \"users1234\".\"username\" FROM \"users\" AS \"users1234\" JOIN \"people\" AS \"people1234\" ON (\"users1234\".\"id\" = \"people1234\".\"id\") WHERE (\"people1234\".\"fname\" = ?)" "Henry")] - - + ;; => ["SELECT \"users3430\".\"username\" AS \"username\" FROM (\"users\" AS \"users3430\" INNER JOIN \"people\" AS \"people3432\" ON (\"users3430\".\"id\" = \"people3432\".\"id\")) WHERE (\"people3432\".\"fname\" = ?)" "Henry"] [`clojure.java.jdbc`][3] support is provided, but must be included explicitly. `clojure-sql` does not depend on `clojure.java.jdbc`. @@ -48,11 +46,11 @@ explicitly. `clojure-sql` does not depend on `clojure.java.jdbc`. (require '[clojure-sql.jdbc :as jdbc]) (jdbc/use-jdbc! "postgres://user:pass@localhost:5432/db") - ; => nil + ;; => nil (deref (-> (s/table :users) (s/project [:id :username]))) - ; => [{:id 5, :username "mange"}] + ;; => [{:id 5, :username "mange"}] Results are returned from queries in an eager vector. -- cgit v1.2.3