DatabaseModule

@Module
object DatabaseModule(source)

Provides the singleton JetpackDatabase in app-private storage.

No migration path is registered. A version upgrade without a path uses destructive fallback, which can erase pending local edits and deletes. Remote re-fetch cannot recover unsent data. Same-version schema-integrity failures are not handled by this fallback.

Before upgrading existing installs, register and test a data-preserving migration, including pending rows. See the data guide's Room persistence section for the extension steps.

Functions

Link copied to clipboard
@Singleton
@Provides
fun provideRoomDatabase(appContext: Context): JetpackDatabase

Provides the database with destructive fallback for missing version migration paths.