Shahor
Shahor
PPrisma
Created by Shahor on 6/10/2024 in #help-and-questions
Failing to write raw query
Hi, I have a (working) raw query that I want to run with prisma but I can't find how to do so and I'm a bit confused as to how I can approach this. For simplicity's sake, my query can be reduced to:
SELECT unnest(array ['foo', 'bar'])
SELECT unnest(array ['foo', 'bar'])
Assuming 'foo' and 'bar' are parameters like:
const values = ['foo', 'bar']
const values = ['foo', 'bar']
Here's what I tried initially:
const rows = await prisma.queryRaw<{ value: string }[]>`
SELECT unnest(array [${values}]
const rows = await prisma.queryRaw<{ value: string }[]>`
SELECT unnest(array [${values}]
But to no success. I've tried a few variations of this but can't for the life of me have it work. Does anyone know how to do this?
9 replies