After enabling RLS on my tables, my Next.js backend API routes using Prisma Client are failing with PrismaClientInitializationError: Can't reach database server.
This error occurs even when the Prisma Client is configured to use the service_role key and the direct database connection string (port 5432).
The most confusing part is that a CLI command like npx prisma migrate dev connects successfully, but the exact same Prisma Client fails within the Next.js application runtime.
My understanding is that the service_role key should bypass RLS entirely. Could you please help me understand why enabling RLS would cause a connection-level failure for a privileged client, and why the CLI and the app runtime behave differently?