I am trying to delete a table in my database (web database) by using a method like this:
private emptyStorage():void{
this.platform.ready().then(() => {
console.log("empty the storage");
this.storage.query("DROP TABLE IF EXISTS cards"),(data)=>{
console.log("deleted",data); // never gets printed
},(error) =>{
console.log("error deleted",error.err); // never gets printed
};
});
}
I know the table exists because I am able to read data from it by writing 'SELECT * FROM cards'
in another query. And I am also able to add items to the table. I can also add that I created the table with this query: 'CREATE TABLE IF NOT EXISTS cards (id INTEGER PRIMARY KEY AUTOINCREMENT, cardId TEXT, name TEXT)'
However, I have not been able to delete the table. Any suggestions on how to delete the entire table?
EDIT: I meant to write TABLE from the beginning, not VIEW. None of them work though