How to create an index for a table in indexedDB using JayData

We tested JayData as an abstraction layer for several data providers in an HTML5 web application designed for multiple platforms and devices.

We also used the Linq2IndexedDB library with some success and using this library we were able to create indexes for tables. But so far, we have not been able to figure out how to do this using the JayData IndexedDB provider or even if it is supported.

Can someone show how to use JayData to create an index for an indexedDb table using JayData?

+4
source share
3 answers

I can confirm that index support is on the way - we look forward to release this year. Not only for IndexedDB, but also for WebSQL / sqLite and mongoDB. Also, with the help of indexes, there will be support for navigation capabilities for key-based stores such as indexeddb and mongodb in the first quarter of 2013.

As for transactions: everything is considered a single (logical) transaction, which occurs when a set of changes is saved using saveChanges. If the provider supports rollbacks than the en error when saving any of the items, it will return any previous changes in the same batch. See the following for an example: webSQL transactions with JayData

@Kyaw Tun Please point me to a document stating that indexed DB data is not important to JayData, so we should take a breath, thanks. I check your library

+2
source

From their documentation, Jaydata does not consider Indexeddb worthy of an efficient database. They seem to ignore the two most important functions of indexeddb: indexing and transaction. However, using Indexeddb correctly is faster than websql.

Try my library https://bitbucket.org/ytkyaw/ydn-db/overview , which loves indexeddb so much, and many tricks use its property.

+1
source

I am developing linq2indexeddb lib. If you have some problems around my library, you can always tell me. I will look at that. Also, if you want to support more browsers (those that use WebSQL), you can add indexeddb shim to your project. This is a pad for using the indexeddb API on top of the WebSQL API. I work with a strip developer, so my library also supports this.

+1
source

Source: https://habr.com/ru/post/1445851/


All Articles