@kirkbyo, I'd be grateful for your eyes on this change, since it involved some plumbing in IDBDatabaseBackend.
At a high level, I'm doing two things here (sorry to have combined them into a single commit—it was a bit tangled):
Adopting modifyEntities in Database.putEvents, rather than getEntities followed by putEntities.
Implementing a "fast path" for the common case of updating an entity snapshot, in which the new events can be applied directly on top of the previous snapshot.
To accomplish this, I had to add a "column" to the backends, and I also had to change modifyEntities's API signature to use general types, rather than Dexie-specific types.
While implementing this, I noticed (thanks, failing tests!) that IDBDatabaseBackend.modifyEntities actually only supported updating pre-existing entities, but not inserting new ones. I fixed that up too.
@kirkbyo, I'd be grateful for your eyes on this change, since it involved some plumbing in
IDBDatabaseBackend
.At a high level, I'm doing two things here (sorry to have combined them into a single commit—it was a bit tangled):
modifyEntities
inDatabase.putEvents
, rather thangetEntities
followed byputEntities
.To accomplish this, I had to add a "column" to the backends, and I also had to change
modifyEntities
's API signature to use general types, rather than Dexie-specific types.While implementing this, I noticed (thanks, failing tests!) that
IDBDatabaseBackend.modifyEntities
actually only supported updating pre-existing entities, but not inserting new ones. I fixed that up too.