package com.key.vibekeyboard.Room;


import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface WallpaperInfoDao {

    @Query("select * from wallpaper_info order by RANDOM() LIMIT 1")
    WallpaperInfo queryRandomItem();

    @Insert
    void insertAll(List<WallpaperInfo> likeDataList);

    @Query("select * from wallpaper_info where preview =:pre ")
    List<WallpaperInfo> checklikelist(String pre);

    @Update
    void update(WallpaperInfo wallpaperInfo);

    @Query("SELECT * FROM wallpaper_info WHERE islike = :islike")
    List<WallpaperInfo> getlikelist(boolean islike);
    @Query("SELECT * FROM wallpaper_info WHERE islike = :islike")
    LiveData<List<WallpaperInfo>> getLiveLikeList(boolean islike);

    @Query("SELECT * FROM wallpaper_info WHERE isDownloaded = :isdownload")
    List<WallpaperInfo> getdownloadlist(boolean isdownload);

}
