Skip to content
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

Table name is unknown in enum generation #98

Open
wuleninja opened this issue Jul 25, 2018 · 0 comments
Open

Table name is unknown in enum generation #98

wuleninja opened this issue Jul 25, 2018 · 0 comments

Comments

@wuleninja
Copy link
Contributor

When generating code for enums, knowing the table can be useful.
For example, we could have 2 tables: contract and project, with each an enum named type.
In this case, if we generate a file for each enum in the same package, without the table name we get a collision.
Using the table name, we can generate 2 files / classes: ContractType and ProjectType.

wuleninja added a commit to wuleninja/gnorm that referenced this issue Jul 25, 2018
This changes allows to use the table name while generating file names or struct
names (in Go) for enums, which may help avoid name collisions (2 tables might
have 2 different enums but with the same column name).

Also: updated the dependencies with dep ensure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant