You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Phonegap/Cordova project using https://github.com/brodysoft/Cordova-SQLitePlugin for using SQLite. There is minor changes made in MainViewController.m to use pre-populated databse (however it might not effect the problem).
The database detecting very well here is the databaase detecting code
function onDeviceReady() {
db = window.sqlitePlugin.openDatabase({name: "database.db"});
db.transaction(queryDB, errorCB);
function queryDB(tx) {
console.log("started");
tx.executeSql("select * from user_info", [], function(tx, res) {
console.log("res.rows.length: " + res.rows.length);
});
}
function errorCB(err) {
console.log("Error processing SQL : "+err.message);
}
}
Result
res.rows.length: 1
Here is the retrieving data code which takes about 10 sec to show result :(
function callMe (argument) {
db.transaction(buttonqueryDB, buttonerrorCB);
function buttonqueryDB(transaction) {
console.log("going to query");
transaction.executeSql('SELECT * FROM home_word', [], function(transaction, result) {
console.log("total itemes " + result.rows.length);
if (result != null && result.rows != null) {
for (var i = 0; i < 10; i++) {
var row = result.rows.item(i);
console.log("this result : " +row.word);
}
}
});
}
function buttonerrorCB(err) {
console.log("Error processing SQL : "+err.message);
}
}
The result above query is searching from 1,25,2100 rows. Testing on iOS emulator takes about 5sec and testing on iPhone takes 10sec 😞
The going to query shows quickly and query result display takes about 10sec
The text was updated successfully, but these errors were encountered:
Internally, the plugin has to convert the query result data to JSON before sending to the Javascript, then the Cordova JS decodes the JSON result data. Needs to be documented in the readme. Batch query API may be able to help solve this.
… with app name (ref: #243); possible stability issue with SockJS client (ref: #196); retrieve of large data set can be too slow due to JSON (ref: #127); memory issue when adding large numbers of records (ref: #18)
The Phonegap/Cordova project using https://github.com/brodysoft/Cordova-SQLitePlugin for using SQLite. There is minor changes made in
MainViewController.m
to use pre-populated databse (however it might not effect the problem).The database detecting very well here is the databaase detecting code
Result
Here is the retrieving data code which takes about 10 sec to show result :(
The result above query is searching from 1,25,2100 rows. Testing on iOS emulator takes about 5sec and testing on iPhone takes 10sec 😞
The going to query shows quickly and query result display takes about 10sec
The text was updated successfully, but these errors were encountered: