Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to VACUUM? #28

Open
brody4hire opened this issue May 9, 2017 · 0 comments
Open

How to VACUUM? #28

brody4hire opened this issue May 9, 2017 · 0 comments

Comments

@brody4hire
Copy link

Raised in storesafe/cordova-sqlite-storage#678 by @tktorza:

Hello,
I try to VACUUM my db after to have delete table content
[...]

tx.executeSql("DELETE FROM event", [], function (tx, rs) {
console.log('SQLITE 1');
tx.executeSql("VACUUM", [], function (tx, rs) {

  		console.log('SQLITE 2');

  	});
  });

but it doesn't work. In documentation you said that it's good to VACUUM database sometimes but I haven't see where to do this?

Thanks

In general I do NOT recommend executing VACUUM within a transaction. I recommend that you wait for an existing transaction to finish then do something like this (not tested):

db.executeSql('VACUUM', [], function(rs) {
 console.log('VACUUM OK');
)};

I will test and document this further when I get a chance.

I hope to add auto-vacuum in the near future ref: storesafe/cordova-sqlite-storage#646

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant