package com.sunny.app.soft.timberkeyboardnew.room

import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.sunny.app.soft.timberkeyboardnew.App
import com.sunny.app.soft.timberkeyboardnew.data.entity.BackgroundEntity
import com.sunny.app.soft.timberkeyboardnew.data.entity.CategoryEntity


@Database(
    entities = [CategoryEntity::class, BackgroundEntity::class],
    version = App.ROOM_VERSION,
    exportSchema = false
)
abstract class MyDatabase : RoomDatabase() {

    abstract fun CategoryEntityDao(): CategoryDao
    abstract fun BackgroundEntityDao(): BackgroundDao


    companion object {
        val myDatabase: MyDatabase by lazy {
            Room.databaseBuilder(
                App.appContext, MyDatabase::class.java,
                App.ROOM_NAME
            ).build()
        }
    }

}