Does Raw Queries Hit Read Replica ?
Hey folks
There are places where we use raw sql queries which are unavoidable , we have a read replica setup as well we did that as suggested in the documentation with prisma/extension-read-replicas package
My question is when using raw queries will the query hit Master DB or read replica.
here is a sample query we use it as per the documentation but mentioning here as well -
await prismaClient.$queryRaw<any>(Prisma.sql SELECT * from "TableName" );
i have tried doing load test on my api end point when using raw query but didn't get any conclusion can someone please help me with this.
Thanks in advance 🙂
1 Reply
Only if you use
$replica()
https://github.com/prisma/extension-read-replicas?tab=readme-ov-file#initializationGitHub
GitHub - prisma/extension-read-replicas: Prisma Client Extension to...
Prisma Client Extension to add read replica support to your Prisma Client - prisma/extension-read-replicas