Covers how to run custom raw SQL queries in Prisma using the $executeRaw and $queryRaw methods. Explains tagged template literals for safe parameterized queries, SQL injection protection, return types with TypeScript generics, and helper utilities like Prisma.join, Prisma.sql, and Prisma.empty for building dynamic queries with IN clauses and conditional WHERE filters.

4m read timeFrom playfulprogramming.com
Post cover image
Table of contents
Method $executeRaw Copy link Link copied!Method $queryRaw Copy link Link copied!

Sort: