From a48ea1c4d295379932782aeb8b4dbf2528c5338e Mon Sep 17 00:00:00 2001 From: "Howard M. Lewis Ship" Date: Tue, 24 Mar 2015 17:31:07 -0700 Subject: [PATCH] Give an example of where combining terms using and --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 3f385bf..758e66d 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,16 @@ To add to clauses instead of replacing them, use `merge-select`, `merge-where`, => ["SELECT a, b, c, d, e FROM foo WHERE (f.a = ? AND b > 10)" "baz"] ``` +`where` will combine multiple clauses together using and: + +```clj +(-> (select :*) + (from :foo) + (where [:= :a 1] [:< :b 100]) + sql/format) +=> ["SELECT * FROM foo WHERE (a = 1 AND b < 100)"] +``` + Inserts are supported in two patterns. In the first pattern, you must explicitly specify the columns to insert, then provide a collection of rows, each a collection of column values: