Room helpers to instantiate your DB and perform transactions in Kotlin.
Supported platforms: Android.
This dependency is not included in any of the fun-packs, because many apps don't need Room, either because they use SqlDelight or another database system, or because they don't need a database at all.
Add it with refreshVersions:
For reference, the maven coordinates of this module are
Room Database instantiation¶
roomDb(…) function has a reified type parameter used to call
Room.databaseBuilder with the proper arguments.
name is the only
You can specify a
Context as first parameter if you don't want to use the
application context, if you want to use a different context (e.g. to use
directBootCtx in a direct boot aware app component).
The last parameter is a lambda with the db builder as receiver where you can things like migrations.