Has anyone had any luck migrating prisma -> drizzle?
Migrating from Prisma to Drizzle is a massive project. There are no migration guides. Is there a great way to migrate query-by-query? Has anybody done this and had any luck? Piecemeal migrations seem like the only practical way to do this
1 Reply
Depends on your project architecture. It's a really hard question, and I'm not sure if it can be documented somehow, simply because of how different each project setup and architecture can be.
The most abstract way to write a guide on migrating from library A to library B, in our case, for data layer management (it doesn't necessarily have to be Prisma to Drizzle, but any other libraries):
1. Introspect (pull) a schema to a database.
2. Rewrite query-by-query. Start with the most interesting one that is causing issues in your application. Try them out and see if library B will solve your problems. If not, I'm not sure if you need to migrate. If yes, continue with the query-by-query strategy.
3. If you are using some sort of "Repository" or "Data layer" patterns, you can do a repository-by-repository migration. You just need to return the same data as before. After migrating all repositories, you can proceed with improving the logic that uses those repositories.
4. Since libraries may have significantly different APIs, you can benefit from rewriting a large part of the logic and using the full power of library B.
As mentioned, there is no way to create a migration guide specifically for your project. All guides will be abstract, similar to the explanation I provided