-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow customizing enum properties #310
Comments
Ah, interesting. The only variation I could think of was people wanting to use I would be happy to accept a PR if you have the time. Can you think of an intuitive way to allow for people to select the |
I'll have a closer look later this week :) Update: |
Well, one thing I am just recalling (which was why I even considered using enum Status {
/** When connected */
ONLINE,
/** When disconnected */
OFFLINE
} Now, this is one of the very few cases where Postgres doesn't have support natively which is why I didn't implement anything for it. But one could imagine a scenario where the comments could come from somewhere else, like a file or an array parsed from a comment on the enum itself. So, I can see three approaches, off the top of my head:
I am not sure which I prefer, or if there is a fourth solution that I am missing. Do you have a preference? |
Personally I'd go with the 3rd approach for now, just to make it simpler :) |
Well, the "refactor later" argument is a bit less valid for a public library. The v3 release had major breaking changes, I hope I won't have to do that again anytime soon. That said, I think approach 3 will work just fine for most people for a long time, so I can live with that. If you would like to take a stab at it, go ahead! |
Just wanted to ask if you plan to allow customizing enum generator? :)
Something similar to getPropertyMetaData?
In our flow we use capitalised and slightly altered 'property' names, example:
enum column with possible values '
dog
', 'cat
', 'one-of-a-kind
' is supposed to be generated to:Currently we use custom logic for doing this (we're still on v2).
In v3 it's hardcoded, so it always outputs this:
This means I have to use postRenderHook to go over processed files and change lines manually in case it's enum, which is not very readable.
I can help with PR if this is something you want to add.
The text was updated successfully, but these errors were encountered: