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:
@@ -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);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user