Prepopulated SQLite Databases in Ionic 2

Hi Ruialves,

I am using latest version of Ionic2, I have used cordova-sqlite-ext but no luck on opening a pre populated database. I have below config.
this.DB.openDatabase({
name: ‘db’,
location: ‘1’, // the location field is required,
backupFlag: 2, // not sure if it is correct value.
existingDatabase: true
})
Please suggest

Hi,

I fixed it because of other topic i created shortly after this one. See: Where to put SQLite databases on Ionic 2 RC0?

Read it and if you have any questions let me know.

i work on Ionic 4 so the www directory is not there anymore ?
any solution please

Hi @Samide

I didn’t use Ionic for the last year so i don’t know if i can help you much.

Try to follow this: https://github.com/iursevla/ionic3-PreDB and port to Ionic 4.

Instead of www folder what is the new folder that replaces www?

Also you can open an issue with: https://github.com/brodybits/cordova-sqlite-ext or https://github.com/xpbrew/cordova-sqlite-storage-help

Sorry if i can’t help much

okey thank you for the shared links

cannot find SqlStorage !! Any idea
should I add it to App.Module or something like that ??