P
Prisma5mo ago
Clément

Problem with $queryRaw (using Prisma.join) that doesn't return any result

Hi I would like to select items via WHERE IN condition, and I followed the documentation but no results are returned despite the fact that the ids exist in the table.
import { Prisma } from '@prisma/client'

const ids = [1, 3, 5, 10, 20]
const result =
await prisma.$queryRaw`SELECT * FROM User WHERE id IN (${Prisma.join(ids)})`
import { Prisma } from '@prisma/client'

const ids = [1, 3, 5, 10, 20]
const result =
await prisma.$queryRaw`SELECT * FROM User WHERE id IN (${Prisma.join(ids)})`
I use MySql 8.0.27, and I really need more documentation to understand why that doesn't work ty
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server