does anyone have experience with Realm? I know the...
# multiplatform
t
does anyone have experience with Realm? I know there is an open ticket on realm-cocoa about supporting multiplatform projects somehow, how difficult would it be to write wrappers around realm-java and realm-cocoa for a kotlin multiplatform project, I'm stuck on how I would approach creating the Realm models... (currently I'm just handling the persistence outside of KMP, maybe this if fine for now until it's officially supported upstream)
s
If it's persistence you're looking for, not necessarily being Realm, consider using SqlDelight.
t
Thanks! SqlDelight looks great. I'm mostly interested in the syncing services offered by realm, would love to use something like SqlDelight but I need some collaborative editing features and don't really want to implement a whole sync engine for that
m
If realm doesnt have any multiplatform support already, you'll probably have to define a common interface for realm-java and realm-cocoa yourself in your common code After that you use a facade pattern (either using
expect
/
actual
keywords or dependency injection), and you should be able to use it in your common code
t
thanks a lot @Mgj, the put me in the right direction, I know they are working on it but not sure when that'l be released officially.
👍 1
m
For what its worth my plan is to use SqlDelight but yeah, i dont think it has the "auto-sync-with-cloud" features as Realm does
t
I've gone down the road of "build your own offline-sync" feature before and while I learned a lot I wouldn't do it myself again 😂