How to open an existing WebSQL database?

前端 未结 1 1658
粉色の甜心
粉色の甜心 2021-01-23 00:19

I\'m building an HTML5/Phonegap mobile application and I want to use an existing SQLite database through WebSQL. By an \"existing\" database I mean I had already created the db.

相关标签:
1条回答
  • 2021-01-23 00:53

    WebSQl has that gotcha. Open database without version and then do version migration, eg:

    var db = openDatabase('mydb', '', 'my first database', 2 * 1024 * 1024);
    
    if (db.version != '1.0) {
       ...
    }
    
    0 讨论(0)
提交回复
热议问题