From 6a9442085ecaf4dfb58ad8b8ee4eea31a3c919c4 Mon Sep 17 00:00:00 2001 From: sivagollapalli Date: Fri, 9 Nov 2018 22:49:50 +0530 Subject: [PATCH 1/2] Docs for Or/And querying --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index d35ddef..ef097d3 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,18 @@ if len(q) > 0 { } ``` +Or query using squirrel + +```go +customers := customers.Where(Or{Expr("country = ?", "US"), Expr("country = ?", "India")}) +``` + +And querying using squirrel + +```go +customers := customers.Where(And{Expr("country = ?", "US"), Expr("country = ?", "India")}) +``` + Squirrel wants to make your life easier: ```go From 2edcea37db2ab31394dc00e3054d5572acf5d6e1 Mon Sep 17 00:00:00 2001 From: sivagollapalli Date: Wed, 5 Dec 2018 14:21:19 +0530 Subject: [PATCH 2/2] Added doc changes for Or/And --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ef097d3..0301826 100644 --- a/README.md +++ b/README.md @@ -67,13 +67,13 @@ if len(q) > 0 { Or query using squirrel ```go -customers := customers.Where(Or{Expr("country = ?", "US"), Expr("country = ?", "India")}) +customers = customers.Where(sq.Or{Expr("country = ?", "US"), Sq.Expr("country = ?", "India")}) ``` And querying using squirrel ```go -customers := customers.Where(And{Expr("country = ?", "US"), Expr("country = ?", "India")}) +customers = customers.Where(sq.And{sq.Expr("country = ?", "US"), sq.Expr("country = ?", "India")}) ``` Squirrel wants to make your life easier: