Skip to content
Kristof degrave edited this page Apr 12, 2017 · 1 revision

Linq2indexedDB Core

The linq2indexedDB.core is a wrapper around the indexeddb API. This is needed because not all browsers implement the spec the same way because it is still in draft. Also there is a difference between the versions within one vendor. So the purpouse of this wrapper is to have a maximum support of all browser vendors and provide more clear errors.

Because the IndexedDB API is asynchronous, the linq2indexedDB Framework, make use of promises to handle the results. This means after you call a method, you need to add callback methods to retrieve the result or errors. You do this by calling the then method on the result of the method call. Next you need to provide callback methods:

  • Success
    • called when the operation was successfull or completed
  • Error
    • called when an error occured inside the operation
  • Progress
    • called when you can hook into the operation or get progress results For more information about promises you can take a look at the jQuery implementation if you are using the linq2IndexedDB framework in a web application and the WinJS implementation if you are using it for a Windows 8 Metro App. Due the limitations of the WinJS promises who can only handle one parameter passed to the callbacks, this parameter will be an array containing all passed arguments.

{{ promise.then(function(args){ // Success callback, extra information is included in the args argument }, function(args){ // Error callback, extra information is included in the args argument },function(args){ // Progress callback, extra information is included in the args argument }); }} The linq2indexeddb core contains the following functions:

Clone this wiki locally