Am I correct that if I’m doing database stuff for ...
# kotlin-native
e
Am I correct that if I’m doing database stuff for MPP for iOS + Android, my options are basically a) SQLDelight b) Write `expect class`es which talk to Room and Core Data
I’m using
exposed
on my server but it appears that only runs on the VJM
k
You can do straight sql, or try my basic sql access lib sqllager https://github.com/touchlab/SQLiter/blob/master/README.md
I would use sqldelight, though
👍 5
e
yeah i am definitely not looking to get super low-level.
k
Expect classes with room and core data would be a nightmare. Sql isn't low level, though ...
e
in reference to this:
k
Can’t see whatever that is on mobile ...
e
screenshot of “SQLager: SQLager is a lower level library.”
k
Sqliter is lower level. It's the driver that sqldelight uses for native. Sqlager, by contrast, is not that
e
Right, you suggested
SQLager
above though
k
I will admit that part of the readme is poorly formated
Yes sqlager is specifically not a liwer level library
message has been deleted
Recent effort has been on lighter, though. Anyway, summary, sqldelight is the best option
e
Ahhhhh that makes more sense now. thanks!
k
If you decide room and core data, please reach out so I can talk you out of it
😛 1
😄 1
🤣 1
e
thanks!
s
I don't even think it would be possible to use K/N as a Core Data model. Between the ObjC runtime magic and the multi-threading it would be a nightmare to even get working.
s
I believe it is possible. Have you tried?
k
I have not. The original Kotlinconf app was coredata, but that was a much earlier version of Kotlin/Native: https://github.com/JetBrains/kotlinconf-app/tree/563e966326cebb4eee49b5ad2c98f5c2d2dfbe3e
s
@svyatoslav.scherbina is there an equivalent to @ dynamic for properties? https://www.ios-blog.com/tutorials/objective-c/synthesize-vs-dynamic/
k
What I have done is a lot of SQLite on mobile, and in the past 3 years, with J2objc and Kotlin Native, a lot of “shared code” mobile. Both in building apps, porting librares (including Room), and writing drivers. If I were doing an Android-only project now I would pick SQLDelight over Room (sorry Yigit). Even if I had a strong preference for Room, writing that logic twice really defeats the purpose of multiplatform, even if iOS devs thought Core Data was amazing. As it happens, I have not met too many iOS devs who thought Core Data wasn’t horrible, so sqlite is probably the easiest case to make when trying to “sell” an iOS team on KMP. That’s roughly my argument for talking you out of it 🙂
s
Very interesting possibilities. It almost makes me want to play with core data again to try it out. Almost