Skip to content

Commit

Permalink
update the function call in a WHERE example
Browse files Browse the repository at this point in the history
  • Loading branch information
koskimas authored and Gaspero committed Oct 2, 2023
1 parent 1d14fcb commit 1abac75
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions site/src/components/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,15 @@ const persons = await db
'JENNIFER'
)
// Alternatively you can use the single callback version.
.where(({ or, cmpr, fn }) => or([
cmpr(fn('upper', ['first_name']), '=', 'JENNIFER'),
cmpr(fn('upper', ['last_name']), '=', 'ANISTON')
]))
.where(({ cmpr, fn }) =>
cmpr(fn('upper', ['first_name']), '=', 'JENNIFER')
)
// Or you can simply use raw SQL if you prefer readability
// over type-safety.
.where(sql\`upper(first_name)\`, '=', 'JENNIFER')
// You can even stick the whole condition to an SQL
// snippet if you prefer
.where(sql\`upper(first_name) = \${'JENNIFER'}\`)
.execute()
`

Expand Down

0 comments on commit 1abac75

Please sign in to comment.