prisma & vulcan-next
j209 opened this issue · 1 comments
j209 commented
Hi
Prisma now supports mongodb.
can vulcan-next integrate with prisma?
eric-burel commented
Hi,
Short answer: yes you can and it will work as expected, but we won't embed Prisma out-of-the-box (except if we find an easy, optional way to do so in the future)
Long answer :
- It can already integrate as long as you create a Prisma connector in Vulcan NPM, like the one we have for Mongo: https://github.com/VulcanJS/vulcan-npm/blob/main/packages/mongo/connector.ts
The connector define basic CRUD operations against the database, that are then used by Vulcan GraphQL layer to get data.
It would be very easy and I would gladly accept a PR introducing a "vulcan-prisma" package that does this.
Then, you can install Prisma in Vulcan Next and use this connector in your models. You don't even need to use Mongo, you can use whatever you want, Vulcan only expects you to define a connector with the relevant basic operations.
- It adds a huge, complex layer to the application, that's why I am not really eager to integrate it out-of-the-box in Vulcan Next starter, even though it has been discussed (and Prisma even sponsored us).
Vulcan differs from a framework like Blitz.js in this respect, we prefer simple, direct and opinionated choices, that are more suited for junior developers and also easier to maintain in the long run.
However I would be ok to add something like a recipe system that automatically install Prisma for you, but I wouldn't maintain something like this officially, that's too much work for the value added.