-
Notifications
You must be signed in to change notification settings - Fork 125
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
Enum types in postgres causes codegen to crash #193
Comments
Hi @masterkidan , |
Thanks for the help, yeah I may have speculated a bit above based on the results of the query. Here's the original table I was using
|
Some more information .. the crash seems to happen with this query:
That happens here Here's the underlying table its trying to query
I believe this may be due to the namespace the enum type is created in. |
The issue is that there are 2 namespaces with the same type
|
Ok, I've manged to reproduce it. If there is an enum with the same name in two different postgres schemas, generator returns an error. |
Describe the bug
A clear and concise description of what the bug is.
Environment (please complete the following information):
Code snippet
Query statement and model files of interest.
Having a type like the above defined in your schema causes generate to fail with the following error:
The issue is with the query here https://github.com/go-jet/jet/blob/c9e627d3336459fd8c676ee354de05601fdf5c2c/generator/postgres/query_set.go
It returns
I believe the query should be
so that you can get the correct types that are being expected here
Expected behavior
A clear and concise description of what you expected to happen.
This should just work automatically
The text was updated successfully, but these errors were encountered: