4

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: enter image description here

Unresolved reference: kotlin

Can I fix this somehow?

Dmitry
  • 130
  • 6
  • This is clearly a bug and should be reported, first of all check out if you can reproduce it with the latest alpha which is **2.0.0-alpha02** ATM - they've fixed a lot of bugs there, if it's still doesn't work - [report it](https://github.com/cashapp/sqldelight/issues/new/choose). – Phil Dukhov May 19 '22 at 18:32
  • was this issue resolved? I'm still getting the same problem in 2.0.0-alpha03 – Sarthak_ssg5 Jan 16 '23 at 09:57
  • No. But it's work. Just ignore this errors for now – Dmitry Jan 19 '23 at 19:25

0 Answers0