Instead of doing an each loop on a JSON file containing a list of SQL statments and passing them one at a time, is it possible with Safari client side storage to simply wrap the data in "BEGIN TRANSACTION" / "COMMIT TRANSACTION" and pass that to the database system in a single call? Looping 1,000+ statements takes too much time.
Currently iterating one transaction at a time:
$j.getJSON("update1.json", function(data){ $j.each(data, function(i,item){ testDB.transaction( function (transaction) { transaction.executeSql(data[i], [], nullDataHandler, errorHandler); } ); }); });
Trying to figure out how to make just one call:
$j.getJSON("update1.json", function(data){ testDB.transaction( function (transaction) { transaction.executeSql(data, [], nullDataHandler, errorHandler); } ); });
Has anybody tried this yet and succeeded?