1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Rework sqlite3_wasm_vfs_unlink(), add sqlite3_wasm_db_vfs(), update some docs.

FossilOrigin-Name: cdd46858f0e63bc7bfce8e339b3db9efdec43b6443ee76563a847f53d0176831
This commit is contained in:
stephan
2022-10-20 05:14:37 +00:00
parent d89a66ec36
commit 842c5ee849
9 changed files with 58 additions and 55 deletions

View File

@@ -365,13 +365,11 @@ sqlite3.initWorker1API = function(){
if(db){
delete this.dbs[getDbId(db)];
const filename = db.getFilename();
const pVfs = sqlite3.capi.wasm.sqlite3_wasm_db_vfs(db.pointer, 0);
db.close();
if(db===this.defaultDb) this.defaultDb = undefined;
if(alsoUnlink && filename){
/* This isn't necessarily correct: the db might be using a
VFS other than the default. How do we best resolve this
without having to special-case the opfs VFSes? */
sqlite3.capi.wasm.sqlite3_wasm_vfs_unlink(filename);
if(alsoUnlink && filename && pVfs){
sqlite3.capi.wasm.sqlite3_wasm_vfs_unlink(pVfs, filename);
}
}
},