HTML5 database storage (SQL lite) - few questions HTML5 database storage (SQL lite) - few questions database database

HTML5 database storage (SQL lite) - few questions


The spec you're looking for is Web SQL Database. A quick reading suggests:

  1. There is no limit, although once your databases increase beyond a certain size (5MB seems to be the default), the browser will prompt the user to allow for more space.
  2. There is no way, in the current spec, to delete databases.
  3. The executeSql() function takes an optional error callback argument.

HTML5 Doctor also has a good introduction.

Going forward, though, I'd recommend looking at Indexed DB. Web SQL has essentially been abandoned since there is no standard for SQL / SQLite. Even Microsoft has endorsed Indexed DB. See Consensus emerges for key Web app standard.


CREATE TABLE IF NOT EXISTS table_name

will create a table table_name only if if does not exist.


I found the following WebSQL tutorials helpful for basic CRUD operations, as they contained examples, and explained what the code was doing:

And the following links for SequelSphere (an HTML5 JavaScript SQL Relational Database Alternative to WebSQL that works in all browsers, storing data in LocalStorage and IndexedDB):