Closed JetA2 closed 1 day ago
Type inference can be weird, this works:
final preferences = result.readWithConverter(users.preferences);
return preferences;
And this works too:
return result.readWithConverter<Preferences?, String>(users.preferences);
I'm not fully sure why inference fails for the original call, but we can't really relax the type of readWithConverter
without introducing other issues. So I'm afraid you'd probably have to use one of the workarounds.
I'm having issues reading a single nullable column that uses a type converter.
To reproduce, I've copied the Preferences code from the documentation on type converters.
When I try to create a function to read the preferences column, the linter complains:
The
readWithConverter
function does not seem to support a nullable value. When I read the whole row, it works fine.Non-functioning code:
Functioning code:
Table:
Am I doing something wrong or is this not supported?