Zod Prisma
A custom prisma generator that creates Zod schemas from your Prisma model.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
-
About The Project
-
Getting Started
- Usage
- Roadmap
- Contributing
- License
- Contact
About The Project
I got tired of having to manually create Zod schemas for my Prisma models and of updating them everytime I made schema changes.
This provides a way of automatically generating them with your prisma
Built With
Getting Started
To get a local copy up and running follow these simple steps.
Prerequisites
This project utilizes yarn and if you plan on contributing, you should too.
Installation
-
Add zod-prisma as a dev dependency
yarn add -D zod-prisma
-
Add the zod-prisma generator to your schema.prisma
generator zod {
provider = "zod-prisma"
output = "./zod"
relationModel = "default"
modelCase = "PascalCase"
modelSuffix = "Model"
}
-
Run npx prisma generate
to generate your zod schemas
-
Import the generated schemas form your selected output location
Usage
TODO
For examples, please refer to the Examples Directory or the Functional Tests
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Carter Grimmeisen - Carter.Grimmeisen@uah.edu
Project Link: https://github.com/CarterGrimmeisen/zod-prisma