LibreTube/app/src/main/java/com/github/libretube/db/DatabaseHolder.kt
2022-08-14 16:36:18 +02:00

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()
}
}