Phonegap: WebSql or SqLite? Phonegap: WebSql or SqLite? database database

Phonegap: WebSql or SqLite?


HTML 5 has this implementation of databases and the implementation is done by embedding Sql Lite database in to browser.

Browser's like chrome and Safari have there implementation of Html5 databases implemented using sqlLite termed as websql but when I was in touch, Mozilla wasn't implementing the Websql instead they were implementing Indexed DB.

Better option I think is to use Backbone.js or Lawnchair although internally both of them use websql but the API's wrap everything for you.

Hope this helps.


I would suggest to go with WebSQL. The detailed reason is as mentioned below:

Lets go ahead and consider the 3 major platforms that you will go with using PhoneGap:

  • IOS: WebSQL - SUPPORTED SQLite - PARTIALLY SUPPORTED
  • Android: WebSQL - SUPPORTED SQLite - FULLY SUPPORTED
  • Windows: WebSQL - NOT SUPPORTED SQLite - NOT SUPPORTED

So ideally it goes like this - You have Windows over which you wrap up a WebSQL Plugin [unreliable] above which you wrap up a SQLite Plugin [highly unreliable].

Hence - It's now your call. Even if you are making phonegap Apps they are mean to be fast and creating layers of one stack over another will definitely make it slow.


var myBuggedDb = window.openDatabase(shortName, version, displayName,maxSize); opens websql database. If you want to use Sqlite, you must use 3rd party plugins like https://github.com/litehelpers/Cordova-sqlite-storage