Hi I’m currently trying to upgrade to Prisma 4 and...
# prisma-client
f
Hi I’m currently trying to upgrade to Prisma 4 and I’m having a little casting issues in some
$queryRaw()
Example query:
Copy code
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:
Copy code
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.
Copy code
IN (${Prisma.join(ids)}::uuid[]) IN (${Prisma.join(ids)})::uuid[]
I wouldn’t mind some help there since I might be missing something simple 😅
👀 1
Doing this works:
WHERE id::text in (${Prisma.join(ids)})
but that’s not an acceptable solution as it breaks the indexing of the id.
Also the
id
column is of `uuid`type here ofc.
Tested a few things, it looks like a regression so I opened an issue:
n
Thank you for opening the GitHub Issue. 🙌 I can see a colleague has already triaged the issue, so they should get back to you on the GitHub Issue.
f
wouldn’t be first time I catch a little regression 😄
But considering the immense complexity on the product, I’m not gonna blame the team for missing a thing or two.
especially since they add tests everytime they catch one to avoid it happening again from what I’ve seen