cacheStrategy in local dev
https://www.prisma.io/docs/accelerate/local-development#using-prisma-accelerate-client-extension-in-development-and-production specifies how to use prisma accelerate client extension in local development, but it's incomplete. Most of my prisma queries have the cacheStrategy property specified. This works fine in production with the accelerate client, but fails with the non-accelerate client.
Is the best practice here to just go through and comment out 50+ instances of cacheStrategy before developing your app locally and then uncomment it later when pushing?
Accelerate: Local development | Prisma Documentation
Learn how to use Prisma Accelerate in a development environment.
2 Replies
Hey 👋
If I understand correctly, you are using two PrismaClient instances, one with Accelerate extension and one without the extension?
Not exactly. I'm only ever using one PrismaClient instance, but I want to use a different (single) instance in two different contexts. I want to use the accelerate client when I deploy to prod and I want to use a non-accelerate client when I am developing locally. How do I do that?