Callback

abstract class Callback
kotlin.Any
   ↳ androidx.room.RoomDatabase.Callback

Callback for RoomDatabase.

Summary

Public constructors

Callback for RoomDatabase.

Public methods

open Unit

Called when the database is created for the first time.

open Unit

Called after the database was destructively migrated

open Unit

Called when the database has been opened.

Public constructors

<init>

Callback()

Callback for RoomDatabase.

Public methods

onCreate

open fun onCreate(@NonNull db: SupportSQLiteDatabase): Unit

Called when the database is created for the first time. This is called after all the tables are created.

Parameters
db SupportSQLiteDatabase: The database.

onDestructiveMigration

open fun onDestructiveMigration(@NonNull db: SupportSQLiteDatabase): Unit

Called after the database was destructively migrated

Parameters
db SupportSQLiteDatabase: The database.

onOpen

open fun onOpen(@NonNull db: SupportSQLiteDatabase): Unit

Called when the database has been opened.

Parameters
db SupportSQLiteDatabase: The database.