aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2023-07-16 12:02:37 +0000
committerstephan <stephan@noemail.net>2023-07-16 12:02:37 +0000
commitaa1b2a80eef92233a4c2d096ab0a09588c106ea2 (patch)
tree2dbacc3e372811605542c847b51a2b0b96c801bf /ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
parent8449dacbd4204dd3144919cd83ae872ca77f2b46 (diff)
downloadsqlite-aa1b2a80eef92233a4c2d096ab0a09588c106ea2.tar.gz
sqlite-aa1b2a80eef92233a4c2d096ab0a09588c106ea2.zip
During "opfs" VFS init, check for URL param opfs-disable and, if set, do not install the VFS. Added per forum suggestion to provide a way to help rule out misinteraction between the "opfs" and "opfs-sahpool" VFSes.
FossilOrigin-Name: 29905b7a75b73e32125bf9116033cae7235a135b668a3b783a3d8dcb0bc80374
Diffstat (limited to 'ext/wasm/api/sqlite3-vfs-opfs.c-pp.js')
-rw-r--r--ext/wasm/api/sqlite3-vfs-opfs.c-pp.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
index c7a752441..35b7b8865 100644
--- a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
+++ b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
@@ -101,6 +101,10 @@ const installOpfsVfs = function callee(options){
options = Object.create(null);
}
const urlParams = new URL(globalThis.location.href).searchParams;
+ if(urlParams.has('opfs-disable')){
+ //sqlite3.config.warn('Explicitly not installing "opfs" VFS due to opfs-disable flag.');
+ return Promise.resolve(sqlite3);
+ }
if(undefined===options.verbose){
options.verbose = urlParams.has('opfs-verbose')
? (+urlParams.get('opfs-verbose') || 2) : 1;
@@ -200,9 +204,9 @@ const installOpfsVfs = function callee(options){
opfsVfs.dispose();
return promiseReject_(err);
};
- const promiseResolve = (value)=>{
+ const promiseResolve = ()=>{
promiseWasRejected = false;
- return promiseResolve_(value);
+ return promiseResolve_(sqlite3);
};
const W =
//#if target=es6-bundler-friendly
@@ -1322,10 +1326,10 @@ const installOpfsVfs = function callee(options){
sqlite3.opfs = opfsUtil;
opfsUtil.rootDirectory = d;
log("End of OPFS sqlite3_vfs setup.", opfsVfs);
- promiseResolve(sqlite3);
+ promiseResolve();
}).catch(promiseReject);
}else{
- promiseResolve(sqlite3);
+ promiseResolve();
}
}catch(e){
error(e);