RoomDatabase.Callback
-
Cmn
abstract class RoomDatabase.Callback
Callback for RoomDatabase
Summary
Public functions |
||
|---|---|---|
open Unit |
onCreate(connection: SQLiteConnection)Called when the database is created for the first time. |
Cmn
android
N
|
open Unit |
Called when the database is created for the first time. |
android
|
open Unit |
onDestructiveMigration(connection: SQLiteConnection)Called after the database was destructively migrated. |
Cmn
android
N
|
open Unit |
Called after the database was destructively migrated |
android
|
open Unit |
onOpen(connection: SQLiteConnection)Called when the database has been opened. |
Cmn
android
N
|
open Unit |
Called when the database has been opened. |
android
|
Public functions
onCreate
open fun onCreate(connection: SQLiteConnection): Unit
Called when the database is created for the first time.
This function called after all the tables are created.
| Parameters | |
|---|---|
connection: SQLiteConnection |
The database connection. |
onCreate
open fun onCreate(db: SupportSQLiteDatabase): Unit
Called when the database is created for the first time. This is called after all the tables are created.
This function is only called when Room is configured without a driver. If a driver is set using Builder.setDriver, then only the version that receives a SQLiteConnection is called.
| Parameters | |
|---|---|
db: SupportSQLiteDatabase |
The database. |
onDestructiveMigration
open fun onDestructiveMigration(connection: SQLiteConnection): Unit
Called after the database was destructively migrated.
| Parameters | |
|---|---|
connection: SQLiteConnection |
The database connection. |
onDestructiveMigration
open fun onDestructiveMigration(db: SupportSQLiteDatabase): Unit
Called after the database was destructively migrated
This function is only called when Room is configured without a driver. If a driver is set using Builder.setDriver, then only the version that receives a SQLiteConnection is called.
| Parameters | |
|---|---|
db: SupportSQLiteDatabase |
The database. |
onOpen
open fun onOpen(connection: SQLiteConnection): Unit
Called when the database has been opened.
| Parameters | |
|---|---|
connection: SQLiteConnection |
The database connection. |
onOpen
open fun onOpen(db: SupportSQLiteDatabase): Unit
Called when the database has been opened.
This function is only called when Room is configured without a driver. If a driver is set using Builder.setDriver, then only the version that receives a SQLiteConnection is called.
| Parameters | |
|---|---|
db: SupportSQLiteDatabase |
The database. |