3

I have hit a quota roadblock on iOS using standard Cordova WebSQL (with MS OpenTech polyfill plugin but I don't think it actually uses that on iOS).

An error is thrown from WebSQL indicating quota exceeded. When this happens I catch the error and drop my main table, then refresh it from the internet.

However, when it hits the quota limit it either will not allow a drop table statement to proceed or the drop statement doesn't free any space because the quota error still keeps coming up. Does anyone know why dropping the table wouldn't free space? I have also tried the vacuum statement which thinks for a while but does not appear to free any space either.

Note that this is an existing app in the field so I would prefer not to switch out the database platform unless we need to. (I see there is a plugin available now (https://github.com/litehelpers/cordova-sqlite-ext) which says it has no quota limit - could be the best/only solution?)

mike nelson
  • 21,218
  • 14
  • 66
  • 75

1 Answers1

0

I decided to replace my default WebSQL with the plugin https://github.com/litehelpers/cordova-sqlite-ext

It went extremely well. This plugin swapped out without any code changes needed in my SQL statements!!! Very pleased!

I tested adding a couple of GB of data to the database and it performed very well and at no point stopped accepting data.

By the way, I tested the limits default WebSQL on iOS and found it dies in a screaming heap at 50MB exactly. You cannot delete any data, drop or vacuum from that point and so you can never recover. It is a pretty serious bug! (This is still recommended as an option on the Cordova docs - it should come with a serious warning)

mike nelson
  • 21,218
  • 14
  • 66
  • 75