Created
March 16, 2018 01:37
-
-
Save skydoves/ed8aba6a97d291bf4fee47e29a1a5059 to your computer and use it in GitHub Desktop.
HistoryDao
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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