![]() As you will see, while there are five official options, fewer are practical. In this chapter, we will examine those five options and see what SQLite does and what the resulting effects are in a Room-based app. However, they may not wind up with different behavior in Room, due to the way that Room works with SQLite. Like FAIL, but continues processing this statement (e.g., if we fail on the 50th row out of 100, keep the changes to the other 99)įor uniqueness violations, deletes other rows that would cause the violation before executing this statement Like ABORT, but accepts prior changes by this specific statement (e.g., if we fail on the 50th row to be updated, keep the changes to the preceding 49) To wit: C:Tmp > type dmlrconflict.sql create table t (species text unique) insert into t values ('dog') insert into t values ('cat') insert into t values ('pig') on conflict do nothing returning rowid, species insert into t values ('dog') on conflict do nothing returning rowid, species drop. ValueĬancel this statement but preserve prior results in the transaction and keeps the transaction alive The pre-v3.35 build I have acts that way. ![]() Each of those OnConflictStrategy values maps to an equivalent SQLite keyword, and each of those strategies results is different behavior in SQLite. Room gives you five OnConflictStrategy enum values to choose from for your onConflict property.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |