IndexedDB events for object storage add, put and delete


I'm new to this forum and I'm not completely sure if I'm posting to right
list. I hope I am.

I've been playing with IndexedDB to learn how to use it and around this
experiment I wrote a blog article about my experiences.

While writing my article, I realized there is no way to add event listeners
for object store to get notifications when new object is added, existing
one is modified or one is deleted. I think lack of these events makes some
use cases much more complicated than one would hope. Use cases like keeping
local data in sync with remote database, synchronizing views between
multiple windows or creating generic data indexers or manipulation
libraries. I know there are ways to go around the lack of these events, but
having those would make things much easier.

Is there any reason why these are not included in the specification? It
just feels bit strange when similar mechanism is included in WebStorage
API, but not in IDB. I suppose right moment to emit these events would be
just after emitting transaction complete.

I wasn't able to find any references from the archives and I hope I'm not
asking same question again. Also I hope I'm not asking this question too

My blog article talks about this in a bit more detailed level under header
"Shortcomings of IndexedDB". The whole article is quite long so you might
want to skip most of it. You can find it from

Miko Nieminen

Received on Tuesday, 5 February 2013 21:54:08 UTC