I need to use a ready sqlite bank that I already have and open it within my project. In the documentation the 'location' of sqlite is always set to: default, so I'm not sure where to save my .sqlite file, or how to open that database, 'openDatabase' no longer works with the ionic update, and create is not opening, but creating a new database, does anyone know how to solve it? Anything helps, thanks! I am using ionic 3 and sqlite 3 and these are the information from my ionic project:
Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.2.1
Xcode version: Not installed
And this is my code:
loading() {
this.platform.ready().then(() => {
this.sqlite.create({
name: 'database_name.sqlite',
location: 'default'
})
.then((db: SQLiteObject) => {
db.executeSql('SELECT * FROM table_name', {})
.then((data) => {
console.log('Executed SQL data: ', data)
}).catch(e => console.log(e, "Error in select"));
})
.catch(e => console.log(e, "Error opening database"));
})
}