is it possible to use ROOM in compose desktop appl...
# compose-desktop
p
is it possible to use ROOM in compose desktop applications?
t
No, Room is an Android library. if you only target desktop you can use any jvm database that does not have android dependencies.
you can checkout SQLdelight and i think there is a few other options https://github.com/cashapp/sqldelight
p
but there are a lot of android components, like corutines, that you can use in compose desktop
I mean, it's what I believe, but I'm still doing my first steps
maybe room will be ported too?
👍🏻 1
t
coroutines is a kotlin thing and has nothing to do with android its just that a lot of android libraries import and use coroutines
p
oh, but when I import some components like corutines, If I'm not wrong, the parent package is called androidx
maybe I'm confused with other components, but I remember to see androidx in some implementations on gradle of my first compose for desktop projects
t
yeah thats because compose multiplatform uses the same api as jetpack compose so when you import LazyColumnt for example you see the package contains androidX
j
Room is being ported to KMP, but it's not ready yet. https://issuetracker.google.com/issues/299168035
And about seeing `androidx`: indeed there's Compose Multiplatform using that (for compatibility with Android Composables) but also DataStore and some others: https://developer.android.com/kotlin/multiplatform
👍 1
m
It is experimental still, not that polished, but I am using it right now in my compose app (including paging etc)
I might need to update the build on jitpack to make sure that all the fixes that were made to handle paging fun are integrated. There are some limitations: All entities must use var (not val). Auto migration not supported Few other minor ones mentioned on the README
If you are starting from scratch with a new desktop application, and you don't have a database preference, then SQLdelight is certainly more stable and probably recommended. If you already have a Room database, or are already otherwise familiar with Room and just want to get Room running on JVM, please do try Door.
p
thanks, I'll check
438 Views