You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/06/23 13:33:18 UTC

[GitHub] [cordova-ios] breautek commented on issue #970: Is webSQL really deprecated in iOS 14 and will be unusable?

breautek commented on issue #970:
URL: https://github.com/apache/cordova-ios/issues/970#issuecomment-866840055


   > is there a way to for migration process to transfer data from websql to the sqlite database in iOS 14 and later
   
   If WebSQL still works, then the easiest way is just to use whatever WebSQL APIs to dump the data from the WebSQL database to another storage mechanism. Doing this ASAP while WebSQL still exists probably should be your top priority so that when users run their app, a migration process can be done to migrate from WebSQL. Depending on the nature of your app and/or data you may need to create a screen that tells the user that a one-time data migration is taken place and they need to wait for it to be completed before they can use the app.
   
   Personally I'd suggest avoiding using browser-based storage solutions (local storage, indexedDB, e.g.). While they may be easier to use, they are still subjected to the browser security policies (by origin) which causes problems when you need to switch webviews (e.g. the recent `UIWebVIew` to `WKWebView` that was forced on us).
   
   For simple data, you can probably just use a flat file, like a JSON file written to the local file system using [cordova-plugin-file](https://github.com/apache/cordova-plugin-file). For larger complicated structures (which I assumed is why you were using WebSQL in the first place), then I'd recommend a third-party SQLite plugin, e.g: [cordova-sqlite-storage](https://github.com/storesafe/cordova-sqlite-storage)
   
   If WebSQL database is not available, then native development knowledge will probably be valuable here but you can try poking around inside the `WebKit` folder, which should exist inside your `NSLibraryDirectory`.
   
   I've never used WebSQL but I've migrated local storage from `WKWebView` null (file) origin to `WKWebView` url scheme origin (e.g: `ionic://localhost`). The `WebKit` folder has a folder for local storage data, so I'm **assuming** there are directories for other web storage mechanisms as well. Then of course, if the websql storage files can be found, then it's a question on whether they are readable or not.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org