Merge pull request #1247 from Jaehwa-Noh/remove-unused-function

Remove Insert function
av/repro-8.3.0-dependency-resolution
Don Turner 9 months ago committed by GitHub
commit 067d68e1c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -92,21 +92,6 @@ class TestNewsResourceDao : NewsResourceDao {
result.map { it.entity.id } result.map { it.entity.id }
} }
override suspend fun insertOrIgnoreNewsResources(
entities: List<NewsResourceEntity>,
): List<Long> {
entitiesStateFlow.update { oldValues ->
// Old values come first so new values don't overwrite them
(oldValues + entities)
.distinctBy(NewsResourceEntity::id)
.sortedWith(
compareBy(NewsResourceEntity::publishDate).reversed(),
)
}
// Assume no conflicts on insert
return entities.map { it.id.toLong() }
}
override suspend fun upsertNewsResources(newsResourceEntities: List<NewsResourceEntity>) { override suspend fun upsertNewsResources(newsResourceEntities: List<NewsResourceEntity>) {
entitiesStateFlow.update { oldValues -> entitiesStateFlow.update { oldValues ->
// New values come first so they overwrite old values // New values come first so they overwrite old values

@ -96,12 +96,6 @@ interface NewsResourceDao {
filterNewsIds: Set<String> = emptySet(), filterNewsIds: Set<String> = emptySet(),
): Flow<List<String>> ): Flow<List<String>>
/**
* Inserts [entities] into the db if they don't exist, and ignores those that do
*/
@Insert(onConflict = OnConflictStrategy.IGNORE)
suspend fun insertOrIgnoreNewsResources(entities: List<NewsResourceEntity>): List<Long>
/** /**
* Inserts or updates [newsResourceEntities] in the db under the specified primary keys * Inserts or updates [newsResourceEntities] in the db under the specified primary keys
*/ */

Loading…
Cancel
Save