package com.example.status_saver.utils;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface ChatDao {
    @Insert(onConflict = OnConflictStrategy.IGNORE)
    void insert(ChatEntity chatEntity);

    @Query("SELECT * FROM ChatRecover")
    List<ChatEntity> getAllChats();


    @Query("SELECT Sender_Name FROM ChatRecover")
    List<String> getPrimaryKeys();
    @Update
    void updateChat(ChatEntity chatEntity);

    @Query("SELECT * FROM ChatRecover WHERE Sender_Name = :Sender_Name")
    ChatEntity getChatById(String Sender_Name);

//    void update()
}
