Local storage for KMP. I've got a few apps on the...
# multiplatform
b
Local storage for KMP. I've got a few apps on the go, and I need some local storage that goes beyond just preferences (I need to sync data for offline). What are people using that works? I've tried Room, its a bit of a pain but would theoretically work with some more fiddling, however I would prefer a document database. The ones i've tried either are not properly supported or simple don't work. leveldb looked promising, but was limited, i had to rip it out almost immediately, Kotbase looked like exactly what I wanted, but it rashes on startup with some sort of native code issue. What are others using? Anything particularly successful?
b
Thanks, I'll take a look.
👍 1
p
sqldelight was recommended to me, though not yet using in practice
👍 2
🆙 2
k
Room is stable as of the latest release KMP 2.7.0 : https://www.linkedin.com/posts/kotlin-multiplatform-updates-and-showcases_%F0%9D%97%9[…]m=member_desktop&rcm=ACoAABLgZyAB-3r6ow-43KHix3QNbEpacWSHgso but personally didn't used with KMP Sqldelight is Kotlin first library, i have been working with it and it's doing the job very well. if you need to save sensitive data you need to implement it separately in each platform for example in Android using Data store or EncryptedSharedPreference..
k
I work at PowerSync - it syncs a backend database with Sqldelight. Could be useful to check out our KMP SDK
👍 1
j
Like @Philipp Kewisch, I also recommend SQLDelight — I use it in a production app.
b
A lot of people suggesting SQLDelight, i've been trying to avoid the raw sql, but I may have to use it just because it works :)
👍 1