Sqldelight: When the query returns only 1 column, ...
# squarelibraries
h
Sqldelight: When the query returns only 1 column, should the compiler generate a new class with only one attribute or return the attribute instead without a (useless) wrapper class? In the gif from the website, after updating
playerForNumber
, the attribute
name
is not found.
p
It depends on the class that is generated. If it's nullable it will be wrapped iirc. Maybe there is more logic to it
h
Ah, but why? :D
The bound of the query is Any
h
Hm, to differentiate between an empty result or a result returning a nullable value.
p
By just looking at the code it could maybe work without the nullable upper bounds
h
Yeah, by rewriting
executeAsOne
.