-
Notifications
You must be signed in to change notification settings - Fork 103
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
Name conflict in generated types #86
Comments
To avoid that, I think enums could be generated in PascalCase (after all it's the common practice with typescript) and/or with Enum prefix, something like : export type EnumDocumentType = "NOTE" | "PAGE";
export namespace documentFields {
export type id = string;
export type document_type = EnumDocumentType;
} |
I like that proposal, nice and simple! |
It will be a breaking change though, because someone could have imported an enum and used it in its code. |
Perhaps an option/flag then? |
@xiamx what do you think on it ? It seems better to include it in next major version (while I doubt many users have enums and import them). |
Yes, preferring a major version bump to have Enum in PascalCase. |
Emitting exports for both snake and camel, but using camel in the interfaces should work |
Nice, that should provide a smooth transition. |
Whats the status on this? |
I'm using a forked version that I have checked into my project with this fix applied. |
Thats to bad! Renaming my enum type while waithing for this. Forking too many libs allready! ;) |
Why not export the enums and all table related interfaces under namespace with the name of the table. |
I have a table
document
with a columntype
of typedocument_type
:This causes a name conflict in the generate types:
The text was updated successfully, but these errors were encountered: