indexeddbshim / IndexedDBShim

A polyfill for IndexedDB using WebSql
Other
968 stars 191 forks source link

Looks like recent IndexedDBShim doesn't work with db.js #206

Closed kir closed 9 years ago

kir commented 9 years ago

Due to this, could not upgrade from IndexedDBShim 0.x to 2.0 in my project. Looks like IndexedDBShim doesn't like passing 'null' instead of undefined as keyRange parameters and such.

Even after that, put(object) without explicit key to a store with keyPath: 'id' didn't work either for me, but it is probably a separate bug.

JamesMessinger commented 9 years ago

The 0.x version of IndexedDBShim was not consistent with native IndexedDB implementations in browsers, which made for a pretty bad polyfill. :) So we've made a ton of changes in 1.x and 2.x to make IndexedDBShim behave the same as native IndexedDB implementations. However, there are a few places where different browsers have different behaviors. In those cases, we implemented the behavior that was used by the most browsers.

So, it's possible that the issues you're experiencing are due to different behaviors between browsers. This is especially the case when it comes to values like undefined, null, NaN, empty arrays, empty strings, etc. For example, take a look at this unit test.

kir commented 9 years ago

I've managed to patch db.js so it now works with the new IndexedDBShim. Thanks for your answer and for writing so many tests :)