package xyz.cottongin.radio247.data.db

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import kotlinx.coroutines.flow.Flow
import xyz.cottongin.radio247.data.model.StationStream

@Dao
interface StationStreamDao {
    @Query("SELECT * FROM station_streams WHERE stationId = :stationId")
    suspend fun getStreamsForStation(stationId: Long): List<StationStream>

    @Query("SELECT DISTINCT stationId FROM station_streams")
    fun getStationIdsWithStreams(): Flow<List<Long>>

    @Insert
    suspend fun insertAll(streams: List<StationStream>)
}
