package com.exquisite.data;

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 MyDAO {
    @Query("SELECT * FROM keyboard_table")
    LiveData<List<Mydata>> getAll();
    @Query("SELECT * FROM keyboard_table")
    List<Mydata> getAlldata();
    @Query("select * from keyboard_table where preview =:pre ")
    List<Mydata> checklikelist(String pre);

    @Query("select * from keyboard_table where className =:classname ")
    List<Mydata> getotherlist(String classname);

    @Query("SELECT * FROM keyboard_table WHERE islike = :islike")
    LiveData<List<Mydata>> getlikelist(boolean islike);

    @Query("SELECT * FROM keyboard_table WHERE title LIKE '%' || :title || '%'")
    List<Mydata> getSearchData(String title);

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

    @Update
    void update(Mydata otherdata);
}
