Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 6eb7c45a authored by Vasu Nori's avatar Vasu Nori
Browse files

make SqliteDatabase ConflictAlgorithm and associated methods public.

SQLiteDatabase.java has ConflictAlgorithm which allows callers to specify
actions to take when insert or update causes constraint violations.
These actions are documented at http://www.sqlite.org/lang_conflict.html.

why make these public? usecase is the following:
Gmail has a table with a column "_id" being the integer primary key and
they let sqlite assign key values to the column.
but there is another UNIQUE key column (message_id) in the table.
so an insert could fail due to constraint violation on the message_id column
(i.e., not on the primary key). and when that happens, they would like to
get the value of _id that caused constraint violation.

currently hidden method insertOnConflict() already provides the above
functionality. that means exposing ConflictAlgorithm also.
parent 35ec7863
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment