You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for nullable columns in joins were added in v1.9.0. Unfortunately, it appears this doesn't extend to the auto-generated enum types. As can be seen in the generated Go types, the ListBooksRow contains an sql.NullString, but the enum type is not similarly nullable.
There's a bit of a design discussion to be had around what the best way to handle this is, since enums use a custom type. Perhaps a pointer would be enough, so that it could be null?
Just wanted to thank you for writing up such a complete bug report. The custom Enum types currently don't support NULL. Once they do (tracking in #1097) the existing JOIN support should "just work".
@kyleconroy hi, is there any traction on this issue? The aforementioned PR #1485 does not fix this particular issue (not sure what it does honestly), when scanning non-nullable enum that's still null as a result of join
I've tested the query in the issue on the playground and it is working properly.
Could you please share what is the model and the query you find problems with?
Activity
kyleconroy commentedon Aug 29, 2021
Just wanted to thank you for writing up such a complete bug report. The custom Enum types currently don't support NULL. Once they do (tracking in #1097) the existing JOIN support should "just work".
sbres commentedon Mar 14, 2022
I've created the PR #1485 that should solve this problem.
Jille commentedon May 2, 2022
@SnoozeThis #1097
(we can add
-> closedif Kyle installs https://github.com/apps/snoozethis)SnoozeThis commentedon May 2, 2022
(https://snoozeth.is/bq_DKWjbxEI) I will wait until #1097 is closed and then add a comment.
sgrishanin commentedon May 11, 2023
@kyleconroy hi, is there any traction on this issue? The aforementioned PR #1485 does not fix this particular issue (not sure what it does honestly), when scanning non-nullable enum that's still null as a result of join
sbres commentedon May 11, 2023
I've tested the query in the issue on the playground and it is working properly.
Could you please share what is the model and the query you find problems with?
johanbrandhorst commentedon May 11, 2023
The original issue does indeed seem to be fixed, thanks!
SnoozeThis commentedon Sep 22, 2023
Resolved.