Prisma accelerate + cockroach + edge deploy
Hello all!
Can I use prisma accelerate to connect a nuxt app deployed to the edge with cockroach db?
ChatGPT says it's not sure about it.
Regards
2 Replies
Skipping coffee for instant knowledge! Let's brew that AI answer now.
You can use Prisma Accelerate to connect a Nuxt app deployed to the edge with CockroachDB, but there are some important considerations:
- Prisma Accelerate is designed to enable database access from edge and serverless environments by providing connection pooling and HTTP-based access, which is especially useful for environments like Vercel Edge Functions or Cloudflare Workers. It works with any database supported by Prisma, including CockroachDB, by acting as a proxy between your edge app and the database Docs: Beyond Prisma ORM Blog: Database access on the Edge.
- CockroachDB support in Prisma is now generally available and production-ready, so you can use all standard Prisma features with CockroachDB, including Prisma Migrate and Prisma Client Blog: CockroachDB GA.
- Nuxt Edge Deployments: The Prisma Nuxt module’s
Yes, you can use Prisma Accelerate to connect a Nuxt app deployed to the edge with CockroachDB, but you must avoid the Nuxt Prisma module’s composable and instead use the edge-compatible Prisma Client setup with Accelerate. This approach is supported and aligns with Prisma’s recommendations for edge deployments. If you need more details on the exact setup, let me know!
usePrismaClient composable does not currently support edge runtimes. If you need edge support, you would need to use Prisma Client directly, following the edge-compatible setup (e.g., using @prisma/client/edge and the Accelerate extension) Docs: Nuxt Prisma Module Limitations Docs: Accelerate Getting Started.
Summary:Yes, you can use Prisma Accelerate to connect a Nuxt app deployed to the edge with CockroachDB, but you must avoid the Nuxt Prisma module’s composable and instead use the edge-compatible Prisma Client setup with Accelerate. This approach is supported and aligns with Prisma’s recommendations for edge deployments. If you need more details on the exact setup, let me know!
The bot response is accurate.
Let us know in case you observe any issues while trying out Accelerate with CockroachDB.