mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 21:27:01 +05:30
data: ignore overwriting when inserting posts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
6867d84ca9
commit
95334d2c8b
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ package dev.msfjarvis.lobsters.data.source
|
|||
import androidx.room.Dao
|
||||
import androidx.room.Delete
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import androidx.room.Transaction
|
||||
import dev.msfjarvis.lobsters.data.model.LobstersEntity
|
||||
|
@ -19,7 +20,7 @@ abstract class PostsDao {
|
|||
insertPosts(posts.map { LobstersEntity(it) })
|
||||
}
|
||||
|
||||
@Insert
|
||||
@Insert(onConflict = OnConflictStrategy.IGNORE)
|
||||
protected abstract suspend fun insertPosts(posts: List<LobstersEntity>)
|
||||
|
||||
@Transaction
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue