package com.gh.gamecenter.room.dao

import androidx.room.*
import com.gh.gamecenter.entity.CommentDraft

@Dao
interface CommentDraftDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun addDraft(draft: CommentDraft)

    @Update(onConflict = OnConflictStrategy.REPLACE)
    fun updateDraft(draft: CommentDraft): Int

    @Query("select * from CommentDraft where id = :id")
    fun getDraftById(id: String): CommentDraft

    @Query("delete from CommentDraft WHERE id = :id")
    fun deleteDraftById(id: String)
}
