Javascript 当从Cordova SQLite插件触发简单查询时,iOS设备挂起

Javascript 当从Cordova SQLite插件触发简单查询时,iOS设备挂起,javascript,ios,sqlite,cordova,Javascript,Ios,Sqlite,Cordova,我已经将SQLite插件与Cordova一起用于对SQLite数据库执行数据库操作。我正在使用Cordova 6.0版和X-Code 7.2版的插件。iOS设备在执行以下代码时挂起,并消耗更多内存 下面的代码段将打开数据库连接: db = window.sqlitePlugin.openDatabase({name: 'sample.db', location: 2}, function(database){ console.log('DB opened successfully in

我已经将SQLite插件与Cordova一起用于对SQLite数据库执行数据库操作。我正在使用Cordova 6.0版和X-Code 7.2版的插件。iOS设备在执行以下代码时挂起,并消耗更多内存

下面的代码段将打开数据库连接:

 db = window.sqlitePlugin.openDatabase({name: 'sample.db', location: 2}, function(database){
    console.log('DB opened successfully in database.js');
    db = database;
    if(dbSuccessCallback != null){
        dbSuccessCallback(db);
    }
}, function(error){
    console.log('DB opening error in database.js');
    if(dbErrorCallback != null){
        dbErrorCallback(error);
    }
});
return db;
下面的代码片段用于在数据库中插入数据

   db.sqlBatch(['create table if not exists app_settings(id integer primary key autoincrement,key_name text,value text)', 'create table if not exists department(id integer primary key autoincrement,department_name text,department_head text,no_of_employees integer)'],function(tx, result){
    console.log('Tables Created successfully');
}

有人能告诉我,我在上面的代码中犯了什么错误,或者是他们的任何其他SQLite插件或任何其他使用Cordova在iOS的SQLite数据库中插入记录的方式吗?

您指向Cordova SQLlite存储的链接已断开。我也一直在努力使用SQLite插件。最后使用cordova sqlite ext:,它在iOS上运行得非常好。请注意sqlite而不是SQLlite:)。