Add upsert to Access interface
Being able to update-or-insert a record makes it easier to avoid
using a Transaction in some cases. SQL doesn't do upsert well,
but non-SQL systems like Apache Cassandra can.
For SQL we try to fake it by updating first, and if that fails,
performing an insert. There is still a possible race condition,
a different thread could perform the insert between our update
failure and our insert attempt.
Change-Id: I384beda849cb815314530440e1bfdb502dadc95a
Signed-off-by: Shawn O. Pearce <sop@google.com>
4 files changed