Sqlite ngCordova


#1

Hello everyone , I have a problem with my app :
I have a file database with a table “test” , located in the www folder of the project ionic , using

$cordovaSQLite.openDB({ name: "database.db", bgType: 1}); 

I can not open the database.

Instead of using

window.sqlitePlugin.openDatabase({name: "database" , createFromLocation: 1 , bgType: 1 , createFromResource:1});

I can open it , but when I try to do a simple select

var query = "SELECT * FROM test";
$cordovaSQLite.execute(db, query, []).then(function(res) {
console.log("OK");}, 
function (err) {console.error(err);});

ionic I do not find the table located inside of the database file.
How can I resolve the issue ?