Skip to content

Commit

Permalink
fix: fix doc for the wherein clause
Browse files Browse the repository at this point in the history
- Missing parenthesis when using WhereIn on multiples columns
- Sprintf was not properly closed
  • Loading branch information
eliecharra committed Dec 9, 2022
1 parent 22497a8 commit 6792ea9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1186,8 +1186,8 @@ Where(
)

// WHERE IN clause building
WhereIn("name, age in ?", "John", 24, "Tim", 33) // Generates: WHERE ("name","age") IN (($1,$2),($3,$4))
WhereIn(fmt.Sprintf("%s, %s in ?", models.PilotColumns.Name, models.PilotColumns.Age, "John", 24, "Tim", 33))
WhereIn("(name, age) in ?", "John", 24, "Tim", 33) // Generates: WHERE ("name","age") IN (($1,$2),($3,$4))
WhereIn(fmt.Sprintf("(%s, %s) in ?", models.PilotColumns.Name, models.PilotColumns.Age), "John", 24, "Tim", 33)
AndIn("weight in ?", 84)
AndIn(models.PilotColumns.Weight + " in ?", 84)
OrIn("height in ?", 183, 177, 204)
Expand Down

0 comments on commit 6792ea9

Please sign in to comment.