Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
HistoryDao
@Dao
interface HistoryDao {
@Query("SELECT* FROM SearchHistory ORDER BY history DESC LIMIT 20")
fun selectRecentHistoryList(): LiveData<List<History>>
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertHistory(history: History)
@Query("DELETE FROM SearchHistory WHERE search = :search")
fun deleteHistory(search: String)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment