Get
operations are now using IDBObjectStore.prototype.getAll internally in all browsers which support this API. Currently these browsers are stable Chromium-based and Firefox. This API is activated when you run fetch operations without index and special direction (e.g. when only limit
, offset
or range
are specified). JSPerf test shows that you get 200%-1000% speed increase for your get operations when using this API, so it's time to update sklad
to this version 😃
A huge work has been done to support library in all major browsers. Now Sklad supports stable versions of Chrome, Firefox, IE11 in Win8/10, Microsoft Edge, Safari9 desktop/mobile and Android browser. All tests run in SauceLabs platform for continuous integration through TravisCI. Special thanks goes to Paul Kilmurray, you're the man!
Short list of changes:
name
field of err
to understand what kind of error occured, nothing changes for you (related commit)package.json
which is more natural to Javascript project (related commit)Check this PR if you want to see all changes: https://github.com/1999/sklad/pull/15/files
sklad
is now working in IE11 and Microsoft Edge browsers. Still there is one browser bug which cannot be fixed inside library: both IE11 and Edge don't support multiEntry indexes (more info). Other library features like working with data, upgrading database and others work as expected. An absence of autoIncrement
field in IDBObjectStore (both IE11 and Edge) is patched inside library (related commit, bug).
IE11 is missing support for native Promise, so you should add some. I was using promise-polyfill inside my tests mostly because it's simple and doesn't replace native Promise with its own implementation.
Safari8 IndexedDB implementation is buggy and is not available to be replaced/shimmed with indexeddbshim so I had to give up on its support. Still IndexedDB implementation in Safari9 is quite okay and sklad
is now working in these browsers (desktop/mobile). Still there are some browser bugs which you should keep in mind:
upgradeneeded
(link). So you can't use indexNames of object store inside versionchange transaction.Safari also fails to work with multiple object stores inside one transaction, but I made a patch for this inside sklad
library (related commit).
Tests are now passing in Firefox.
Published by 1999 about 9 years ago
this
in migration scripts now refers to IDBOpenDBRequest so that you can create indexes on top of already created object stores. Check out docs for more info.skladConnection.close()
method to explicitly close existing connection (#3)blocked
event support with InvalidStateError
DOMErrorString
or Error
. Check out docs for examples.skladConnection.get()
invokes callback with not objects but array with objects with key
and value
keys (details). Previously it was an object and this was a design error.There's also a short migration guide here.