Hi, don’t know if you still need help but if you still need help i figured it out.
Basically you need to use the plugin cordova-sqlite-ext.
-
To install use ionic plugin add cordova-sqlite-ext
-
Copy your Database file to the /www folder
-
In one of your classes (i tried it on MyApp class contructor after the platfor.ready(…) do this:
this.storage = new Storage(SqlStorage,
{
name: ‘WUT.db’, <- Name of your database .db
location: 1,<- Don’t know if this makes any difference
backupFlag: SqlStorage.BACKUP_LOCAL,
existingDatabase: true <-This way you’re looking for an existing DB
}); -
Now do something like
storage.query(‘SELECT * from table’).then
(
(data) => { console.log(data): },
(error) => { console.log(error); }
});