Phonegap: WebSql or SqLite?

后端 未结 3 946
北荒
北荒 2021-02-19 13:00

I have been working with phonegap for little time, and i\'m having some trouble with the concept of storage in it.

So, the documentation states that there is this datab

相关标签:
3条回答
  • 2021-02-19 13:28

    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.

    0 讨论(0)
  • 2021-02-19 13:28

    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.

    0 讨论(0)
  • 2021-02-19 13:34

    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

    0 讨论(0)
提交回复
热议问题