SQLite i get Error


#1

Hi guys

I want to create a table with sqlite. But i geht the errormessage ‘cordova_not_available’.

..
this.platform.ready().then(() => {
      sqlite.create({
        name: 'data1234.db',
        location: 'default'
      }).then((db: SQLiteObject) => {
        db.executeSql(`create table danceMoves(name VARCHAR(32));INSERT INTO danceMoves VALUES ('hehehe')`, {})
            .then(() => console.log('Executed SQL'))
            .catch(e => console.log('Fehlermeldung'+e));


      })
          .catch(e => console.log('Fehler '+e));
    });
..

Platform

Cordova CLI: 7.0.0
Ionic Framework Version: 3.1.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.6
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.10.2

What can i do?


#2

Where are you running your Ionic app? If you are only running ionic serve, this won’t work as sqlite is probably from a Cordova Plugin (which one? this is important information) and not available in ionic serve.