package com.key.vibekeyboard.data.database;


import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import com.key.vibekeyboard.MyApplication;
import com.key.vibekeyboard.data.database.entity.WallpaperInfo;
import com.key.vibekeyboard.data.database.dao.WallpaperInfoDao;

@Database(entities = {WallpaperInfo.class}, version = MyApplication.DB_VERSION, exportSchema = false)
public abstract class AppDatabase extends RoomDatabase {

    public abstract WallpaperInfoDao wallpaperInfoDao();

    private static AppDatabase INSTANCE;

    public static AppDatabase getInstance() {
        if (INSTANCE == null) {
            synchronized (AppDatabase.class) {
                INSTANCE = Room.databaseBuilder(MyApplication.getContext(), AppDatabase.class, MyApplication.DB_NAME).build();
            }
        }
        return INSTANCE;
    }


}
