I'm creating a database and a table for my node webkit app, using this :
var db = openDatabase('vizDb', '1.0', 'Visualiation database', 2 * 1024 * 1024);
db.transaction(function (tx) {
query = 'CREATE TABLE IF NOT EXISTS dataworking (id, ACV, sales, Date)';
tx.executeSql(query);
$.each(records, function(i,thisRecord){
records[i] = thisRecord.split(',');
query = 'INSERT INTO dataworking (id, ACV, sales, Date) VALUES (' + thisRecord + ')';
//console.log(query); //query is correct here
tx.executeSql(query);
});
});
But when I do the following, I don't get the records in the console.
db.transaction(function (tx) {
query = 'SELECT * FROM dataworking';
tx.executeSql(query , [], function (tx, results) {
var len = results.rows.length ;
for (i = 0; i < len; i++) {
console.log(results.rows.item(i));
}
});
});
I want to check if my records are entered currently. For this, I go to the location
..AppData\Local\Package-name\databases and I see a file Databases.db and a folder file__0 with a file named '1'. I run the SQLite prompt from the location ../file__0/ and list the tables
sqlite>.open 1
sqlite>.tables
sqlite> __WebKitDatabseInfoTable__
But there is no table named dataworking.
How do I open the database vizDb and check if the table 'dataworking' is made?