Open CaseyHaralson opened 1 year ago
I should mention that the compilation works after running prisma generate. But I assume this shouldn't be necessary?
Yes, running prisma generate
is necessary. I think this is because $queryRaw
depends on the provider.
We could maybe mention something in the docs.
Ok. I was hoping it would be possible to push the functions on to the Prisma module without a generate.
I was able to copy the join function out as a shim, and that worked, but ran into more functions that needed the generate to be run first. I ended up just running prisma generate before running my project build/unit tests. shrug
For example, on MongoDB these utilities would not make sense as they are only useful when using SQL.
But I get the point that it could be nice if it would be always available without having to generate 👍🏼
Bug description
I'm using Prisma in a typescript project and the join function is causing the file to fail compilation with: Property 'join' does not exist on type 'typeof Prisma'
I referenced this from the documentation: https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#tagged-template-helpers
How to reproduce
Copy the following in to a Typescript file:
import { Prisma, PrismaClient } from "@prisma/client";
export function test() { const pc = new PrismaClient(); const results = pc.$queryRaw
select A as test from TEST where A in (${Prisma.join( ["1", "2"] )})
; }Expected behavior
The join function should exist on the Prisma type.
Prisma information
Dependency on "@prisma/client": "^4.8.0"
Environment & setup
This is an issue in Windows and in github workflows.
Prisma Version