Re: IndexedDB events for object storage add, put and delete

One solution would be to don't call directly to IndexedDB methods but
instead use custom wrappers that fit better with your application
(this is what I'm doing), but definitelly I totally agree with you
that IndexedDB should raise events when a row has been
inserted/updated/deleted. I think it was talked about it would be an
explosion of events, but I'm not sure about this... having events
would be useful to develop triggers to maintain database consistency,
for example :-)

2013/2/5 Miko Nieminen <miko.nieminen@iki.fi>:
> Hi,
>
> 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
> late.
>
> 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
> http://mini-thinking.blogspot.co.uk/2013/02/web-app-example-using-indexeddb.html
>
> Thanks,
> --
> Miko Nieminen
> miko.nieminen@iki.fi
> miko.nieminen@gmail.com
>



-- 
"Si quieres viajar alrededor del mundo y ser invitado a hablar en un
monton de sitios diferentes, simplemente escribe un sistema operativo
Unix."
– Linus Tordvals, creador del sistema operativo Linux

Received on Tuesday, 5 February 2013 22:00:15 UTC