Closed yyfearth closed 8 years ago
Sorry yeah, I'm not planning on supporting it. You can DROP
all tables and do a VACUUM
afterwards instead. The SQLite files will still be there, but they will be empty.
My goal with this project is not to reinvent SQLite; it's just to shim WebSQL. Thanks for the understanding!
@nolanlawson I know I can drop tables, but I do not know how I can do VACUUM
since there is no db.executeSql
like the original plugin
And I do not think
db.transaction(function (txn) {
txn.executeSql('VACUUM', null, function (tx, res) {
console.log(res);
});
});
Error code 1: cannot VACUUM from within a transaction
wil work.
I have to reclaim spaces either via vacuum or delete database, or the database file size will be out of control.
Ah, sorry about that. Yeah maybe you can't VACUUM. In that case, SQLite will clean up the files when it decides to. Sorry, but again this isn't something I intend to support.
If you'd like, you can fork this project and create your own version which adds the features you need, though. Or the original SQLite Plugin can do all these things.
I know you pointed out that close and delete db are non-goals for this project. But I still need to remove the db sometime later in order to reset all data.
I think it might be fine to use file plugin to directly delete the db file from the FS. But I'm not sure if that is possible and safe since there is no close db api.
The reason to use the sqlite plugin instead of indexedDb or WebSql for my app is that it might need a lot of storage, and need to support Android and iOS (both UIWebView and WKWebView) Currently I use the original plugin but I do not like it embedded a sqlite engine, but without support of deleting db, I cannot switch to this plugin.
Thanks