What Should You Use with Room?
Given the deprecations, your options with Room now are very straightforward:
- If you want to replace the database contents with new data when there is a conflict, use
REPLACE
- If you want to keep the existing database contents when there is a conflict, but not treat it as an error, use
IGNORE
- If you want to keep the existing database contents when there is a conflict, and you want an exception to be raised so you know about the problem, use
ABORT
(or, do nothing, asABORT
is the default strategy)
Prev Table of Contents Next
This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.