volatiletech / sqlboiler

Generate a Go ORM tailored to your database schema.
BSD 3-Clause "New" or "Revised" License
6.73k stars 544 forks source link

Option to disable struct tag generation #1250

Open OscarVanL opened 1 year ago

OscarVanL commented 1 year ago

If you're having a generation problem please answer these questions before submitting your issue. Thanks!

What version of SQLBoiler are you using (sqlboiler --version)?

4.14.1

What is your database and version (eg. Postgresql 10)

Postgresql 14

Further information. What did you do, what did you expect?

In my application I have a distinction between API structs and database structs so I can more closely control which fields get exposed to users.

When sqlboiler generates the ORM, it includes json, toml, and yaml struct tags. Ideally, I don't want to accidentally mislead my colleagues that these are API models rather than database models, but the inclusion of these tags could make it appear this way.

For this reason I'd love an option to disable these tags.

stephenafamo commented 1 year ago

I understand your concerns. Since it does not affect the actual usage I would be reluctant to add an extra option (that then has to be maintained in the future)

If you contribute an implementation that is relatively straightforward, then I'll review it and may consider merging.