Hi, everyone
I use in last time ionic to build a mobile app but have some problems to get rows from table with sqlite plugin
if someone can help me
version
nodejs 4.4.7
cordova 6.2.0
ionic 2.0.0-beta.10
ionic cli 2.0.0-beta.35
android platform 5.1.1
my code
this.storage = new Storage(SqlStorage, {name:‘appDb’});
this.storage.query(‘CREATE TABLE IF NOT EXISTS favorites (item_id int(11) NOT NULL);’);
this.storage.query('select * from favorites').then((resp) => {
console.log(JSON.stringify(resp));
});
log
{"tx":{"db":{"openargs":{"name":"appDb","location":2,"createFromLocation":0,"backupFlag":2,"existingDatabase":false,"dblocation":"nosync"},"dbname":"appDb"},"txlock":true,"readOnly":false,"executes":[],"finalized":true},"res":{"rows":{"length":10},"rowsAffected":0}}
My problem is i have lenght = 10 but i dont get array of rows