Writing raw queries
Hi, is there a way to write a raw query? It seems like context.$queryRaw is not a function
7 Replies
hmm we don't expose it through context right now, but trying to think if there is some workaround you could use right now. What do you need it for exactly?
nice @Zeko369 ! This should def solve the issue but just to note it isn't the part of the official API yet. It would still be great to learn about your specific use case @GreatValorKing π
This is the first time using Prisma, I needed to join 3 tables. Prisma docs and ChatGPT weren't helpful. In the end, I actually came up with the came code as @Zeko369, but I thought that there's gonna be something more official. Anyways thanks for help, that was quite quick π
Hmm, what do you mean join 3 tables?
You can with
include
I.e.
thanks for the help on this @Zeko369 that is an "unofficial" way to do it but should be stable for now. and yes, using Prisma for relationship
includes
would be ideal if you can @GreatValorKing πAnd Prisma's API should generally be enough for most CRUD apps. Resorting to raw queries should rarely be necessary.