Florian Thelliez
08/24/2022, 11:36 AM$queryRaw()
Example query:
const rows = await this.prismaClient.$queryRaw<
{ id: string; location: string }[]
>(Prisma.sql`
SELECT id, ST_AsGeoJSON(location) as location,
FROM something
WHERE id IN (${Prisma.join(ids)})
`);
I get some type errors I didn’t have in previous versions:
ERROR: operator does not exist: uuid = text
I’ve tried various way to cast my list of ids to uuids, but to no avail so far.
IN (${Prisma.join(ids)}::uuid[]) IN (${Prisma.join(ids)})::uuid[]
I wouldn’t mind some help there since I might be missing something simple 😅Florian Thelliez
08/24/2022, 11:48 AMWHERE id::text in (${Prisma.join(ids)}) but that’s not an acceptable solution as it breaks the indexing of the id.Florian Thelliez
08/24/2022, 11:49 AMid column is of `uuid`type here ofc.Florian Thelliez
08/24/2022, 2:31 PMFlorian Thelliez
08/24/2022, 2:31 PMNurul
08/25/2022, 7:09 AMFlorian Thelliez
08/25/2022, 12:18 PMFlorian Thelliez
08/25/2022, 12:18 PMFlorian Thelliez
08/25/2022, 12:19 PM