Created
February 16, 2022 02:20
-
-
Save Farhandroid/be02139debe79c063d6079e71108edbd to your computer and use it in GitHub Desktop.
MovieDao
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 MovieDao { | |
@Insert(onConflict = OnConflictStrategy.REPLACE) | |
suspend fun addMovies(movies: List<Movie>) | |
@Query("SELECT * FROM movies") | |
fun getAllMovies(): PagingSource<Int, Movie> | |
@Query("SELECT * FROM movies WHERE movieId = :movieId") | |
fun getMovie(movieId: Int): Flow<Movie> | |
@Query("DELETE FROM movies") | |
suspend fun deleteAllMovies() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment