mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 23:00:31 +05:30
22 lines
496 B
Kotlin
22 lines
496 B
Kotlin
package com.github.libretube.db
|
|
|
|
import android.content.Context
|
|
import androidx.room.Room
|
|
import com.github.libretube.constants.DATABASE_NAME
|
|
|
|
class DatabaseHolder {
|
|
fun initializeDatabase(context: Context) {
|
|
Database = Room.databaseBuilder(
|
|
context,
|
|
AppDatabase::class.java,
|
|
DATABASE_NAME
|
|
)
|
|
.fallbackToDestructiveMigration()
|
|
.build()
|
|
}
|
|
|
|
companion object {
|
|
lateinit var Database: AppDatabase
|
|
}
|
|
}
|