Replies: 1 comment
-
Sadly, I don't think there is currently an answer to coerce the compiled type to a Kotlin Int when you have an SqlDelight type adapters In SqlDelight, the The problem is that as soon as the expression There was an issue #3572 that was supposed to use the Kotlin type as the preferred type - however this doesn't appear to work when there is an expression that becomes an The fix #4517 doesn't appear to take account of expressions and obeys the following rules
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Suppose I have the following query
where
sort_idx
is of typeInt
via the primitive adapters and works fine as typeInt
in all generated code UNLESS I useCOALESCE
in a query, where it defaults back to the default type (Long
on the kotlin side).ChatGPT and some internet search suggested to use this syntax to return
Int
fromCOALESCE
queries:but this does not compile.
Is there a way to make the
SELECT
return the correct type even withCOALESCE
?For completeness, here is the table definition:
Beta Was this translation helpful? Give feedback.
All reactions