mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-16 07:10:29 +05:30
20 lines
442 B
Kotlin
20 lines
442 B
Kotlin
package com.github.libretube.db
|
|
|
|
import android.content.Context
|
|
import androidx.room.Room
|
|
import com.github.libretube.DATABASE_NAME
|
|
|
|
object DatabaseHolder {
|
|
lateinit var db: AppDatabase
|
|
|
|
fun initializeDatabase(context: Context) {
|
|
db = Room.databaseBuilder(
|
|
context,
|
|
AppDatabase::class.java,
|
|
DATABASE_NAME
|
|
)
|
|
.fallbackToDestructiveMigration()
|
|
.build()
|
|
}
|
|
}
|