diff options
author | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-07-01 08:15:56 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-07-01 08:15:56 +1000 |
commit | 4d69593b6038d3df035aae0bd278103a56ec6500 (patch) | |
tree | 6c126dedb69dddf19d247e78595bc91d95d989b1 | |
parent | be3302010635abd27adb64f58964baa7d205428e (diff) |
A bit more readme changing
-rw-r--r-- | README.md | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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\""] |