Updating cordova-plugin-sqlite β€” how to load my existing database?

I released an Ionic app earlier this year for both iOS and Android which makes use of cordova-sqlite-storage. In preparing for a new release, today I updated the Android and iOS cordova platforms and updated all plugins.

In my existing version of the app, my call to $cordovaSQLite.openDB does not specify a location. This is fine for the version of the plugin I am using in production. However, the newer versions require a location to be specified when opening the DB.

I have no idea what I am supposed to put for the location when trying to open an existing DB from a version of sqlite where no location was specified. Using the option 'default' isn’t working, it is just creating a new database on both Android and iOS. This is not acceptable as this new DB has none of the user’s stored data.

How can I specify a location that will always correspond to the location from older versions of the sqlite plugin?

1 Like