cordova-plugin-indexedDB

Cordova plugin for IndexedDB

  • Owner: microsoft/cordova-plugin-indexedDB
  • Platform:
  • License:: Other
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

IndexedDB plugin for Apache Cordova

Implements Indexed Database API support for Apache Cordova apps based on IndexedDBShim implementation.

Support of Android and iOS.

Sample usage

Plugin follows Indexed Database API specification, no special changes are required. The following sample code creates todo store (if not exist) and adds new record.

var openReq = window.indexedDB.open("sampleDatabase");
openReq.onupgradeneeded = function (event) {
    var db = event.target.result;
    db.createObjectStore("todo", {autoIncrement: true});
};
openReq.onsuccess = function (event) {
    var db = event.target.result,
        sampleItem = { 
            todo: "my todo item",
            added_on: new Date()
        };
    var addReq = db.transaction("todo", "readwrite").objectStore("todo").add(sampleItem);
    addReq.onsuccess = function (event) {
        console.log("Operation completed successfully");
    };
    addReq.onerror = function (event) {
        console.log("Operation failed");
    };
}
openReq.onerror = function (event) {
    console.log("Operation failed");
}

Installation Instructions

Plugin is Apache Cordova CLI 3.x compliant.

  1. Make sure an up-to-date version of Node.js is installed, then type the following command to install the Cordova CLI:

     npm install -g cordova
    
  2. Create a project and add the platforms you want to support:

     cordova create sampleApp
     cd sampleApp
     cordova platform add android
     cordova platform add ios
    
  3. Add IndexedDB plugin to your project:

     cordova plugin add com.msopentech.indexeddb
    
  4. Build and run, for example:

     cordova build android
     cordova emulate android
    

To learn more, read Apache Cordova CLI Usage Guide.

Copyrights

Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

Overview

Name With Ownermicrosoft/cordova-plugin-indexedDB
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:Other
Release Count0
Created At2014-05-06 16:48:48
Pushed At2023-06-15 20:25:12
Last Commit At2015-10-06 11:41:12
Stargazers Count64
Watchers Count21
Fork Count21
Commits Count15
Has Issues Enabled
Issues Count10
Issue Open Count6
Pull Requests Count3
Pull Requests Open Count5
Pull Requests Close Count0
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private
To the top