The PhoneGap Web SQL Database documentation at http://docs.phonegap.com/en/3.1.0/cordova_storage_storage.md.html#SQLTransaction lists the following JavaScript code fragment:
function populateDB(tx) {
tx.executeSql('DROP TABLE IF EXISTS DEMO');
tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
}
Am I guaranteed that the four SQL statements in the above code fragment will execute sequentially (i.e., the DROP TABLE command will definitely execute first, followed by the CREATE TABLE statement second, etc)? There are lots of postings about the asynchronous nature of the PhoneGap Web SQL Database API, but I can't find any postings about the sequential nature of the PhoneGap Web SQL Database API. As you might imagine, it doesn't make any sense for the CREATE TABLE statement to execute if the DROP TABLE statement didn't first finish executing.