Hello! Is SQLDelight a recommended library to be u...
# multiplatform
a
Hello! Is SQLDelight a recommended library to be used for caching in KMM project? Can Realm instead be used? Are there any examples where Realm has been used successfully and is better than SQLDelight?
m
Realm KMP is very new, I wouldn't use it in a production application just yet. SQLDelight is what I would recommend currently.
a
Thanks
m
SQLiter says it is only for Kotlin Native (Apple and Windows variants). They say it powers SQLDelight native targets, which would be another thing to look at.
j
fwiw I have example of using Realm in KMP project in https://github.com/joreilly/FantasyPremierLeague
👍 1
k
Sqliter is the driver for sqldelignt on native. It's not really intended to be used directly.
The debate is really between realm and sqlite the database, and let's say that's an old debate. Realm for kmp is pretty new, but it kind of depends what you're doing. I'd generally pick sqldelight, even if realm was mature, but I've been a SQL fan all through the "nosql" thing, and I manage sqliter, so there is bias there
Original version of that message had some phone keyboard autocomplete issues, so I'll try again. SQLDelight works on several platforms, SQLiter is only native, but it's just a driver for SQLDelight, so if you want sql on KMP, SQLDelight is your best option. Realm is new for KMP, and interesting tech, but the debate between Sqlite and Realm has been going on for some time, and even if Realm were mature, I'd personally lean sql, but again, I'm biased.
👍 1
c
We recently decided to migrate our app from SQLite (Room) to Realm. On iOS we use Core Data and that has saved us bucket loads of time. Think 5x faster development of data layer. This is due to our specific use case where our app is truly offline first, and Core Data allows us to easily model ~500 relationships. Imagine writing and maintaining that many join tables (has anyone successfully done something like that btw?). Realm should give us the same ability to model relationships and flexibly query the data we need to display