How to compress WebSQL database from JavaScript How to compress WebSQL database from JavaScript sqlite sqlite

How to compress WebSQL database from JavaScript


Due to the abondoned/work stopped nature of WebSQL, bugs/feature requests were not - and will not - ever be honored. This same problem exists as a Chromium bug, for instance, with no response.

It appears that the worst is true of your two questions:

1: Because the vacuum command can only be run when not connected to the database, it can only be run from the command line. There is no "disconnect database and then run VACUUM" command in browsers or javascript, it seems.

2: Don't count on it. It is not clear that it will even run when it hits the max size limit, and even if it does you'll notice major slowdowns long before you hit the max size limit.

At most you might be able to send a command to a plug-in, or something outside the javascript context, that could itself run the command...it's deprecated now so it's rather a moot point. For a legacy application if you have to have the function it will have to be done outside the simple webpage/js context.

Future/modern applications use IndexedDB now; this question has been answered for legacy applications only.