In my KMM project I'm using SQLdelight. My sample table has a List. Table:
CREATE TABLE profile (
nikName TEXT,
secretKey TEXT,
description TEXT,
tagList TEXT AS List<String>
);
According to documentation I created adapter:
//TODO we cant use comas in this string. Convert to JSON
object ListOfStringsAdapter : ColumnAdapter<List<String>, String> {
override fun decode(databaseValue: String) =
if (databaseValue.isEmpty()) {
listOf()
} else {
databaseValue.split(",")
}
override fun encode(value: List<String>) = value.joinToString(separator = ",")
}
It compiles and works, but Android Studio marks import and List with red:
Unresolved reference: kotlin
Can I fix this somehow?