-
Notifications
You must be signed in to change notification settings - Fork 66
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
Enable interoperability with ent #50
Comments
Hi @dmarkham, would be nice to hear your opinion on this. Thanks :) |
I think a new flag to add this method would be just fine. |
great! I'll prepare a PR
…On Thu, Oct 21, 2021 at 2:39 AM Dan Markham ***@***.***> wrote:
I think a new flag yo add this method would be just fine.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#50 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGMIMCRBJPHMVN745QZTBJ3UH5OKXANCNFSM5GEW67FA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@dmarkham Thanks for merging! Would you mind bumping the patch version? |
@dmarkham pls bump version, so that the changes make it into the release. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, to improve interoperability with ent and support its enum type-safety, I'd propose to add the
Values() []string
method (from the EnumValues interface) to the generated enum types, next toString() string
.This feature should likely be opt-in, so it would be beneficial to add a flag for it. I'd propose
-values
(or-valuesFunc
) flag.I've seen, there is already a generated
***Strings() []string
-func, which would just need to be wrapped by theValues() []string
method in question.@dmarkham Would you be open for a PR for this?
An Example:
P.S.: I understand there's a potential for confusion, due to the pre-existing
PillValues() []Pill
function. But to have typesafety with enums in ent, this proposal is the only way to go from what I see.The text was updated successfully, but these errors were encountered: