1package com.parseable.android.data.local
3import androidx.room.Dao
4import androidx.room.Delete
5import androidx.room.Insert
6import androidx.room.OnConflictStrategy
7import androidx.room.Query
8import kotlinx.coroutines.flow.Flow
11interface FavoriteStreamDao {
12 @Query("SELECT * FROM favorite_streams ORDER BY addedAt DESC")
13 fun getAll(): Flow<List<FavoriteStream>>
15 @Query("SELECT streamName FROM favorite_streams ORDER BY addedAt DESC")
16 fun getAllNames(): Flow<List<String>>
18 @Insert(onConflict = OnConflictStrategy.REPLACE)
19 suspend fun insert(favorite: FavoriteStream)
22 suspend fun delete(favorite: FavoriteStream)
24 @Query("DELETE FROM favorite_streams WHERE streamName = :name")
25 suspend fun deleteByName(name: String)
27 @Query("SELECT EXISTS(SELECT 1 FROM favorite_streams WHERE streamName = :name)")
28 fun isFavorite(name: String): Flow<Boolean>
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list