Sqlite stand alone db .. three collections within.
I am trying to modify the example code (http://devcenter.appery.io/tutorials/...) to match my db and its collections. Here is the example you provided:
var db = window.openDatabase("Wedding 0.1", "", "Wedding 0.1", 1024*1000);
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS "Tables"(_objectId TEXT, number TEXT, left TEXT, top TEXT, visible TEXT, _createdAt DATETIME, updatedAt DATETIME)', []);
tx.executeSql('SELECT * FROM "Tables" WHERE "objectId" = "' + value.id + '"', [], function(tx, results){
console.log('rows :' + results.rows.length);
if (results.rows.length == 0){
console.log('Go and add table ' + value.number);
tx.executeSql('INSERT INTO "Tables" (objectId, number, left, top, visible, _createdAt, updatedAt) values (?, ?, ?, ?, ?, ?, ?)', [value.id, value.number, value.left, value.top, value.visible, value.createdAt, value.updatedAt]);
}
});
});
My question is this: How do I add all three collections using this topology? Do I simply repeat the entire script three times with the different collections mapped out in each? Please help.