chrishoermann / zod-prisma-types

Generator creates zod types for your prisma models with advanced validation
Other
578 stars 43 forks source link

[Feature Request] Ignore useless input types improve performances #260

Open Spoutnik97 opened 1 week ago

Spoutnik97 commented 1 week ago

For a simple schema.prisma :


model User {
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt @map("updated_at")
  id        String   @id @default(uuid()) @db.Uuid
  email     String   @unique
  name      String?
  posts     Post[]
}

model Post {
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt @map("updated_at")
  id        String   @id @default(uuid()) @db.Uuid
  title     String
  content   String?
  published Boolean  @default(false)
  author    User     @relation(fields: [authorId], references: [id])
  authorId  String
}

If I activate the createInputTypes option, my type file grows from ~50 lines to 1200 lines... So with my real schema, it is more than 40 000 lines of codes. It takes more than 1 minutes to execute the tsc command for my package

I would like to add an option to choose only the CreateInputTypes (and maybe the UpdateInutTypes) ,but not all the CreateManyAndReturn, ConnectOrCreate, etc...