Replies: 2 comments 2 replies
-
|
Hi @Lqm1! If you want to see the SQL generated by Prisma for debugging or analysis (such as for EXPLAIN), the recommended approach is to enable query logging when instantiating your PrismaClient: const prisma = new PrismaClient({ log: ['query'] });This will print the SQL queries Prisma executes, including the ones generated from your where clauses, to your console. You can then manually copy the SQL and run EXPLAIN on it in your database client if needed. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, As we have not heard back from you, we are closing this discussion to keep our discussions organized. Feel free to start a new discussion if this remains relevant. Thank you for being part of the community! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I want to execute the EXPLAIN on our customary where-clause objects, such as:
Because user determine the contents of the where clause, i must either execute EXPLAIN with the where clause or convert the objects in the where clause to SQL.
How to reproduce (optional)
Expected behavior (optional)
No response
Information about Prisma Schema, Client Queries and Environment (optional)
// Add your schema.prisma// Add any relevant Prisma Client queries hereOS: Windows
Database: PostgreSQL
Node.js version: Bun 1.2.22
Run
prisma -vto see your Prisma version and paste itBeta Was this translation helpful? Give feedback.
All reactions