https://kotlinlang.org logo
Title
a

Ashu

03/29/2023, 7:59 AM
Is there "any" sample project on using SQLiter library in KMM? I have been searching a lot for any sample but unable to find one. I know it is not recommended to be used directly, but it fits my use-case better since our whole project has lots of legacy raw queries and migration process would be painful when using SQLDelight.
k

kevin.cianfarini

03/29/2023, 12:12 PM
You could use a raw
SqlDriver
to issue queries in SQLDelight if you'd like
a

Ashu

03/30/2023, 6:41 AM
@kevin.cianfarini but that returns SQLDelight's SQLCursor which doesn't have getColumnIndex function.
k

kevin.cianfarini

03/30/2023, 12:36 PM
SqlCursor offers functions to get items from a column but requires that you know their type. Like
SqlCursor.getLong(index: Int)
.
It should be noted that SQLiter is only for Kotlin/Native, not for MPP. you won't be able to use it in the JVM or JS for example.