summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@clearboxsystems.com.au>2013-07-01 08:15:56 +1000
committerCarlo Zancanaro <carlo@clearboxsystems.com.au>2013-07-01 08:15:56 +1000
commit4d69593b6038d3df035aae0bd278103a56ec6500 (patch)
tree6c126dedb69dddf19d247e78595bc91d95d989b1
parentbe3302010635abd27adb64f58964baa7d205428e (diff)
A bit more readme changing
-rw-r--r--README.md9
1 files changed, 8 insertions, 1 deletions
diff --git a/README.md b/README.md
index f141494..360a16d 100644
--- a/README.md
+++ b/README.md
@@ -37,10 +37,17 @@ Thus: `(and (= :name "Barry") (= (length :username) 10))` compiles
into an SQL expression equivalent to `("name" = 'Barry' AND
"length"("username") = 10)`.
-A few more involved query examples:
+A few more query examples:
(require '[clojure-sql.core :as s])
+ ;; this is only shown as a demonstration
+ ;; a query like this is not advised for general use
+ (s/table :users)
+ ;; => ["SELECT * FROM \"users\" AS \"users1715\""]
+
+ ;; it is recommended that a query be projected first to provide
+ ;; clojure-sql with field information
(-> (s/table :users) ;; tables are automatically given internal aliases
(s/project [:id :username]))
;; => ["SELECT \"users3205\".\"id\" AS \"id\", \"users3205\".\"username\" AS \"username\" FROM \"users\" AS \"users3205\""]