Phonegap: WebSql or SqLite?

为君一笑 提交于 2019-12-04 00:08:45

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.

Ankit Tanna

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!