precedent icon indicating copy to clipboard operation
precedent copied to clipboard

Switch to Drizzle

Open NuroDev opened this issue 2 years ago • 3 comments
trafficstars

image

Okay for real though, while Prisma is awesome, I think the next best move for this project would be considering switching to Drizzle as it offers a lot of the benefits of Prisma but fixes a number of the core issues that many people have with it.

The main 2 being codegen & edge support. Since Drizzle allows you to create your schema purely in TypeScript there is no need to generate types from a .prisma file. Then of course the switch to a "native driver" or HTTP driver, like @planetscale/database, to allow for use in a V8 isolate / edge runtime.

How

Probably one of the biggest blockers going in would be porting the current Prisma schema to Drizzle, which should not be too hard.

I have successfully done this myself already for my own custom data as well as using these PR's in the NextAuth.js repo showing how to implement the tables needed to handle NextAuth.js / Auth.js.

If need be I am happy to help migrate the Prisma schema to a Drizzle schema 🙂

NuroDev avatar Apr 18 '23 23:04 NuroDev

I've been looking at Drizzle and it does indeed seem like a strong alternative to Prima, but it feels too early at this stage to be recommending it on bootstrapper projects that are designed to be deployed to production by many users. Wait a year or two for it to mature, docs to improve, and then consider adopting it in these types of projects.

gamedevsam avatar Jul 01 '23 18:07 gamedevsam

As an example, it seems JSON functionality is a bit hit or miss right now: https://github.com/drizzle-team/drizzle-orm/issues/748

gamedevsam avatar Jul 01 '23 18:07 gamedevsam

Yeah, I agree @gamedevsam, but I do love drizzle and would love to see it grow soon!

vignesh-gupta avatar Oct 12 '23 15:10 vignesh-gupta