summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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\""]