Skip to content

Commit

Permalink
use camelCase in README's example
Browse files Browse the repository at this point in the history
  • Loading branch information
keegancsmith committed Aug 18, 2023
1 parent fb8d6b7 commit 236993b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ simplifies this task with `sqlf.Join`:

```go
// Our inputs
min_quantity := 100
name_filters := []string{"apple", "orange", "coffee"}
minQuantity := 100
nameFilters := []string{"apple", "orange", "coffee"}

var conds []*sqlf.Query
for _, filter := range name_filters {
conds = append(conds, sqlf.Sprintf("name LIKE %s", "%"+filter+"%"))
for _, filter := range nameFilters {
conds = append(conds, sqlf.Sprintf("name LIKE %s", "%"+filter+"%"))
}
sub_query := sqlf.Sprintf("SELECT product_id FROM order_item WHERE quantity > %d", min_quantity)
q := sqlf.Sprintf("SELECT name FROM product WHERE id IN (%s) AND (%s)", sub_query, sqlf.Join(conds, "OR"))
subQuery := sqlf.Sprintf("SELECT product_id FROM order_item WHERE quantity > %d", minQuantity)
q := sqlf.Sprintf("SELECT name FROM product WHERE id IN (%s) AND (%s)", subQuery, sqlf.Join(conds, "OR"))

fmt.Println(q.Query(sqlf.PostgresBindVar))
fmt.Println(q.Args())
Expand Down

0 comments on commit 236993b

Please sign in to comment.