Skip to content

Commit

Permalink
Add limit
Browse files Browse the repository at this point in the history
  • Loading branch information
ashiagr committed Feb 6, 2023
1 parent 8a37a8a commit 3c6b738
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import au.com.shiftyjelly.pocketcasts.models.entity.SearchHistoryItem
@Dao
abstract class SearchHistoryDao {
@Transaction
@Query("SELECT * FROM search_history ORDER BY modified DESC")
abstract fun findAll(): List<SearchHistoryItem>
@Query("SELECT * FROM search_history ORDER BY modified DESC LIMIT :limit")
abstract fun findAll(limit: Int = 10): List<SearchHistoryItem>

@Insert(onConflict = OnConflictStrategy.REPLACE)
abstract suspend fun insert(searchHistoryItem: SearchHistoryItem)
Expand Down

0 comments on commit 3c6b738

Please sign in to comment.