Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@tawasukha/zod-prisma
Advanced tools
Forked Version Prisma generator that creates Zod schemas for all of your models
A custom prisma generator that creates Zod schemas from your Prisma model.
Initially this generated was created by Carter Grimmeisen, but unfortunately only support for Prisma 3. I got tired of having update Zod Schema manually. This repo provides generating prisma schema model and keep the simplicity.
To get a local copy up and running follow these simple steps.
Ensure your tsconfig.json enables the compiler's strict mode. Zod requires it and so do we, you will experience TS errors without strict mode enabled
Add zod-prisma as a dev dependency
pnpm add -D @fortezhuo/zod-prisma
Add the zod-prisma generator to your schema.prisma
generator zod {
provider = "zod-prisma"
output = "./zod" // (default) the directory where generated zod schemas will be saved
relationModel = true // (default) Create and export both plain and related models.
// relationModel = "default" // Do not export model without relations.
// relationModel = false // Do not generate related model
modelCase = "PascalCase" // (default) Output models using pascal case (ex. UserModel, PostModel)
// modelCase = "camelCase" // Output models using camel case (ex. userModel, postModel)
modelSuffix = "_model" // (default) Suffix to apply to your prisma models when naming Zod schemas
imports = null // (default) will import the referenced file in generated schemas to be used via imports.someExportedVariable
// https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values
prismaJsonNullability = true // (default) uses prisma's scheme for JSON field nullability
// prismaJsonNullability = false // allows null assignment to optional JSON fields
}
Run npx prisma generate
or pnpm dlx prisma generate
to generate your zod schemas
Import the generated schemas form your selected output location
Distributed under the MIT License. See LICENSE
for more information.
Carter Grimmeisen for awesome Prisma Generator https://github.com/CarterGrimmeisen/zod-prisma
FAQs
Forked Version Prisma generator that creates Zod schemas for all of your models
The npm package @tawasukha/zod-prisma receives a total of 0 weekly downloads. As such, @tawasukha/zod-prisma popularity was classified as not popular.
We found that @tawasukha/zod-prisma demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.