Performance: Why Prisma offers type-safe database access
MEDIUM IMPACT
This concept affects development speed and runtime error reduction, indirectly improving user experience by preventing runtime crashes and unnecessary database queries.
const user = await prisma.user.findUnique({ where: { id: userId } });const user = await prisma.$queryRaw`SELECT * FROM users WHERE id = ${userId}`;
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Raw SQL queries without type safety | N/A | N/A | N/A | [X] Bad |
| Prisma type-safe queries | N/A | N/A | N/A | [OK] Good |