Santi Buenahora
08/17/2022, 10:00 PMPrisma.ProductWhereInput
into a raw WHERE statement?
Or to get the SQL for a call like prisma.product.find_many({ where })
?Nurul
08/18/2022, 8:34 AMimport { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient({
log: ['query'],
});
Here’s a sample output for a create query:
prisma:query BEGIN
prisma:query INSERT INTO "public"."User" ("username") VALUES ($1) RETURNING "public"."User"."id"
prisma:query SELECT "public"."User"."id", "public"."User"."username" FROM "public"."User" WHERE "public"."User"."id" = $1 LIMIT $2 OFFSET $3
prisma:query COMMIT
{ id: 3, username: 'alice' }