create-prisma-generator
doesn't support Prisma 4 yet, it works with Prisma 3, but that doesn't mean that you can't upgrade on your own quite smoothly.
Any contributions to support Prisma 4 in the create-prisma-generator
are highly appreciated and will be part of the authors/contributors section of this tool.
Prisma is Database ORM Library for Node.js, Typescript.
Prisma has a concept called "Generator". A generator is an executable program, which takes the parsed Prisma schema as an input and has full freedom to output anything.
The most prominent generator is called prisma-client-js
. It's the ORM Client powering the main TypeScript and JavaScript usage of Prisma from Node.js.
Generators will always be called when you run prisma generate
. However, only the generators mentioned in the schema.prisma file are being run.
Strongly recommend reading the full article, It's pretty damn good
As a community, developing prisma generators is really hard cause that's a very new concept to us so It's like knowing JS but being exposed to do ML with it for the first time and there is nothing documented about @prisma/sdk (this is done intentionally) which has a very great utilities when developing or testing prisma generators and the only way you can get started is by looking at other generators code which might be useful to get you started.
I'm really obsessed with this architecture that Prisma Client is built on and I can see a bright future for Prisma Generators from the community to integrate Prisma nicely with different frameworks or make tools that can beneift from Prisma models.
But unfortunately I didn't have a smooth experience developing my prisma generator.
So I created this CLI to encourage developers to make their own prisma generators to have a smooth experience with all of the annoying repetitive things carried away like: getting started boilerplate, publishing, testing the gen locally by running prisma generate
, ..etc
Answer the prompt questions to setup your project, The project setup will be based on your answers.
npx create-prisma-generator
Your environment will have everything you need to build your prisma generator like an elite open-source maintainer:
prisma generate
.yarn
, pnpm
and npm
.Read Architecture.md to understand how everything is working.
The Create Prisma Generator community can be found on GitHub Discussions, where you can ask questions, suggest ideas, and share your projects.
We'll be very thankful for all your contributions, whether it's for helping us find issues in our code, highlighting features that're missing, writing tests for uncovered cases, or contributing to the codebase.
Read the Contributing guide to get started.