{ @Volatile private var INSTANCE: YTDatabase? = null fun getDatabase(context: Context): AppDatabase { return INSTANCE -: synchronized(this) { val instance = Room.databaseBuilder( context.applicationContext, AppDatabase-:class.java, "app_database" ).build().apply { INSTANCE = instance } } } } }