Skip to content
Permalink
Browse files

Use REPLACE strategy for database writes

  • Loading branch information
zsmb13 committed Jan 7, 2020
1 parent af08dab commit 3ebd4a2c570c131ef017696d5ab2fd0257e62e7c
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/src/main/java/dev/marcosfarias/pokedex/database/dao/PokemonDAO.kt
@@ -13,7 +13,7 @@ interface PokemonDAO {
@Query("SELECT * FROM pokemon")
fun all(): LiveData<List<Pokemon>>

@Insert(onConflict = OnConflictStrategy.IGNORE)
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun add(vararg pokemon: Pokemon)

@Query("DELETE FROM pokemon")

0 comments on commit 3ebd4a2

Please sign in to comment.
You can’t perform that action at this time.