Prisma ORM · Prisma Client queries

Run raw SQL safely

Use the tagged template, which sends values as parameters and prevents SQL injection.

const email = "[email protected]";
const rows = await prisma.$queryRaw`SELECT * FROM "User" WHERE email = ${email}`;

Official Prisma ORM documentation

More prisma client queries commands

All prisma client queries commands · Prisma ORM cheatsheet

Was this page helpful?