Skip to content

Commit

Permalink
+ Code Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Mina Mikhail committed Aug 20, 2021
1 parent 1a88f19 commit b0b8769
Showing 1 changed file with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,13 @@ import com.mina_mikhail.newsapp.features.news.domain.entity.model.Article

@Dao
interface ArticlesDao {
/**
* Select all articles from the articles table.
*
* @return all articles.
*/

@Query("SELECT * FROM articles")
fun getAll(): LiveData<List<Article>>

/**
* Insert articles in the database. If the article already exists, replace it.
*
* @param article the city to be inserted.
*/
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insert(article: Article)

/**
* Delete article from the articles table.
*
* @param article the city to be inserted.
*/
@Delete
suspend fun delete(article: Article)
}

0 comments on commit b0b8769

Please sign in to comment.