Hi there! Is it possible to specify types for fiel...
# squarelibraries
s
Hi there! Is it possible to specify types for fields of a
VIEW
in SQLDelight? We can do that for tables, but not for fields coming out of a
SELECT
statement in a
VIEW
definition. My use case is this: I generate a little JSON array (using
GROUP_CONCAT
) in one of my view's fields, and would love to bind it to a Kotlin type, and make a ColumnAdapter convert it using kotlinx.serialization.
Note that I already have this working by simply doing two queries (the reason for the JSON is getting all related items in a many-to-many relationship), so this isn't a deal-breaker or anything. I could as well simply do that after I get the query's results in the Kotlin side, and then deserialize the string there. So this is more about ergonomics, and it may not be worth supporting.