I need to create an HTML5 Web SQL database (I realize that it's deprecated) for use on the iPad. It used to be with iOS 6 that you could create a 50 MB database right off the bat. But now iOS 7 has introduced a bug (see this article) that prevents a 50 MB database from being created. I understand that the workaround for this bug is to create a small database and grow it as needed. Safari will prompt the user to grow at 10 MB, 25 MB and 50 MB. However, when the user is prompted to increase the size of the database, my JavaScript code that does the inserting of data just stops running. What am I doing wrong? (This happens on iOS 6 and 7.) There's no error thrown from what I can tell. How can I proceed with the inserts after the user prompt to grow the database? My Web SQL insert code is below (some code left out for brevity):
db.transaction(function (tx) {
var insertSQL = 'insert into ...';
for (var i = 0; i < len; i++) {
var items = [{}]; // the items to insert
tx.executeSql(insertSQL, items, function (tx, results) {
// When all items are inserted, fire the callback method if there is one
if ((++itemsInserted === itemsToInsert) && $.isFunction(callback)) {
callback();
}
}, function (tx, error) {
if (console && $.isFunction(console.warn)) {
console.warn(error.message);
}
});
}
});
The above code works fine on iOS 6 if the database was created initially with 50 MB. However, when the database starts out small, this code is no longer working. Thanks for your time and help on this!
Thanks,
Andy