prisma / extension-read-replicas

Prisma Client Extension to add read replica support to your Prisma Client
Apache License 2.0
96 stars 6 forks source link

Is `readOperations` correct for `$queryRaw` and `$queryRawUnsafe`? #14

Open notsoluckycharm opened 9 months ago

notsoluckycharm commented 9 months ago

I think a minor change is required on the readOperations list. If you run a $queryRaw it will not match, as inserting a log statement yields the operation to contain the dollar sign. So these will not use the replica.

'$queryRaw', '$queryRawUnsafe',

I ask because making this change (and I would have PR'd it) loses the return types that the top level client gives you.

TypeError: Cannot destructure property 'prisma__type' of 'object null' as it is null.

So it would seem raw query on the replicas is currently unsupported.

casey-chow commented 9 months ago

For the TypeError you mentioned, I have a ticket on the main repo for that: https://github.com/prisma/prisma/issues/21139

crice88 commented 9 months ago

I'm running into this same issue. @casey-chow thanks for PR, @SevInf can we get some traction on getting this merged in? Thanks all!