yathit / ydn-db

Javascript database module for Indexeddb, Web SQL and localStorage storage mechanisms supporting version migration, advanced query, SQL and transaction.
Apache License 2.0
503 stars 41 forks source link

DataError in Microsoft Edge #95

Open bennycode opened 8 years ago

bennycode commented 8 years ago

Hello, by using YDN in my web application with Microsoft Edge I am getting a DataError. The JavaScript inspector says it comes from key_range.js (265,3).

I am using:

When I run the same code in Chrome or Firefox, then it works.

yathit commented 8 years ago

Yes, it is known issue for over three years now. MS don't have time to fix, so I am.

bennycode commented 8 years ago

So can you tell me what's the problem in Edge? Why is it complaining? Maybe I can setup a different database schema to go work around this issue.

yathit commented 8 years ago

Yes, avoid multiEntry and compound index. See more on https://dev.yathit.com/ydn-db/doc/setup/limitation.html

bennycode commented 8 years ago

Ok, thanks for the fast reply. So with Edge I cannot use a schema like this:

{
  name: 'name, timestamp',
  keyPath: [
    'name', 'timestamp'
  ]
}

But this is needed when I want to do queries like:

db.from('users').where('name', '=', 'Homer').order('timestamp');

Is there another way of not using a compound index but being able to query by name and order by timestamp?

mtycholaz commented 8 years ago

There is support in Edge for basic IndexDb. They're considering adding more complex features. More info from Microsoft regarding this here.

https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/8437039-full-feature-support-for-indexeddb