aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-worker1.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-10-20 05:14:37 +0000
committerstephan <stephan@noemail.net>2022-10-20 05:14:37 +0000
commit842c5ee84951da8524221e0546d41e4f3a1a18f0 (patch)
tree69fe682e0d6d57c46478a0c4d34510bb0df729cb /ext/wasm/api/sqlite3-api-worker1.js
parentd89a66ec36491c1d98a1bbeb04dac4e74d66f754 (diff)
downloadsqlite-842c5ee84951da8524221e0546d41e4f3a1a18f0.tar.gz
sqlite-842c5ee84951da8524221e0546d41e4f3a1a18f0.zip
Rework sqlite3_wasm_vfs_unlink(), add sqlite3_wasm_db_vfs(), update some docs.
FossilOrigin-Name: cdd46858f0e63bc7bfce8e339b3db9efdec43b6443ee76563a847f53d0176831
Diffstat (limited to 'ext/wasm/api/sqlite3-api-worker1.js')
-rw-r--r--ext/wasm/api/sqlite3-api-worker1.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/wasm/api/sqlite3-api-worker1.js b/ext/wasm/api/sqlite3-api-worker1.js
index 55faab282..6c0900a50 100644
--- a/ext/wasm/api/sqlite3-api-worker1.js
+++ b/ext/wasm/api/sqlite3-api-worker1.js
@@ -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);
}
}
},