SQLite can't executeSql


I found a creppy solution by that issue, it is still working in Android and iOS

The documentation says:
Execute SQL on the opened database. Note, you must call openDatabase first, and ensure it resolved and successfully opened the database.

By some reason the database don’t is open succesfully, so try to open again

public database: SQLite;

 this.database = new SQLite();

this.database.openDatabase({name: "data.db", location: "default"}).then(() => {
    this.database.executeSql('Insert statement', []).then((data) => {
    }, (error) => {
        console.log("ERROR insert: " + error);

 }, (error) => {
     console.log("ERROR open database: ", error);
1 Like