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
Using ENUM type #61
Comments
Hey there, So first off let me explain that we don't have proper enum support currently. The next thing to say is that you can still use sqlboiler and enums as strings, since this is how the driver works internally anyway, the only problem is that you can't run the compatibility tests since the randomize package doesn't understand the valid values for your enum type. What we're going to do is the following:
If this sounds okay to you then we can start work on this. One more thing, the TestUpsert is failing in a way I don't expect, is it possible that you can run that test in isolation along with debug mode? We may have a bug here. go test -v -run 'TestUpsert/Events' ./models -test.debug |
Check docs for more information on this new feature. |
Hi,
At first thanks for such great tool! The workflow combined with both goose and sqlboiler works very well and conveys the impression of doing things in elegant manner :)
I have encountered a problem when ENUM type is used, for example:
Executing sqlboiler output warning:
Warning: Incompatible data type detected: workday
Thus the models directory is created, running tests
go test models/
results in massive fail log:
models/event.go
If combine the warning, test output and generated code the answer is simple: enum type is not handled properly and it is treated as string type.
Are there any workarounds (other than editing generated files) for such case? (or maybe I have done something wrong?).
Thanks for your help!
Have a nice day
EDIT:
Of course the easiest workaround:
The text was updated successfully, but these errors were encountered: