Giter VIP home page Giter VIP logo

websql-to-indexeddb-example's Introduction

Intro

Few simple example that show you the power of both indexedDB and WebSQL. The main.html part is taking two examples of the same code (more or less). Both show how to work with WebSQL and indexedDB in order to save data in the client side.

The jqm is a shortcut for jQueryMobile and there you can see the two examples that use JQM with indexedDB and WebSQL in order to create a simple web app for todo list. Classic, no?

Examples

(!) Please note that since November 18, 2010, the W3C announced that Web SQL database is a deprecated specification. This is a recommendation for web developers to no longer use the technology as effectively the spec will receive no new updates and browser vendors aren't encouraged to support this technology. Many major browsers including Chrome, Safari, Opera and nearly all Webkit based mobile devices support WebSQL, however, if you are going to start a new project and/or you wish to have your code running with the new version of client side database (that will receive updates and improvements) you should implement indexedDB as your client side DB.

Todos

  • Check how it's working in Chrome 42.
  • Check the options to leverage a lib. for multi browsers support.

Be strong

Analytics

websql-to-indexeddb-example's People

Contributors

axe-sneakpeeq avatar greenido avatar james2doyle avatar paullewis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

websql-to-indexeddb-example's Issues

The request.onupgradeneeded part, db.version === dbVersion

Seems when this function is invoked, the db.version has been changed.
So, I try to change codes as followed, please check:

    request.onupgradeneeded = function(e) {
        todoDB.indexedDB.db = e.target.result;
        var db = todoDB.indexedDB.db;
        console.log ("Going to upgrade our DB from version: "+ e.oldVersion + " to " + e.newVersion);
        if(db.objectStoreNames.contains("todo")) {
            db.deleteObjectStore("todo");
        }

        var store = db.createObjectStore("todo", {keyPath: "timeStamp"});
        console.log("-- onupgradeneeded store:"+ JSON.stringify(store));
    };

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.