omar-dulaimi / prisma-joi-generator

Prisma 2+ generator to emit Joi schemas from your Prisma schema
MIT License
41 stars 9 forks source link

Provide option to turn-on or off specific types of generated Joi files. #7

Open NextStepGuru opened 1 year ago

NextStepGuru commented 1 year ago

Problem

I need the ability to turn on or off specific generated Joi files. For example, *Upsert* and *Unchecked* I will never use. These files just create added files generated without any addition purpose. The problem comes in when you have a large database with many relationships and foreign relationships. Deployment systems like Docker/Google App Engine and Amazon Beanstalk have max file limits.

Suggested solution

In addition to break up the outputted files into directory named by table-name. Provide a list of flags that can turn on and off specific generated file-types. The files I care most about is *Create* and *Update* for my REST API.

omar-dulaimi commented 1 year ago

I think this is doable, just disabling the generation of Upsert and Unchecked. Though this means not just the schemas wouldn't be generated; but also the key names would be removed, in case of Upsert => all upsert keys will be removed. So if you use Typescript, I don't know if this might cause you some problem or require you more work.

Let me know what you think.