aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-opfs.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-09-19 13:44:23 +0000
committerstephan <stephan@noemail.net>2022-09-19 13:44:23 +0000
commit0e0687ccfc2c898489cdc7ca8116b2dd2a3bcb54 (patch)
treef2d6a3574f2fefbbcb9fbca3693e48b5db3962cc /ext/wasm/api/sqlite3-api-opfs.js
parentb5ae85eca27f43949ae81a8489c3168ebcf7164c (diff)
downloadsqlite-0e0687ccfc2c898489cdc7ca8116b2dd2a3bcb54.tar.gz
sqlite-0e0687ccfc2c898489cdc7ca8116b2dd2a3bcb54.zip
Add sqlite3_web_vfs_list() to JS API. Corrected OPFS VFS's registering itself as the default VFS. speedtest1-worker now uses the xDelete() of both the default VFS and OPFS, to avoid that it starts up with a persistent OPFS test db (the native app calls unlink(), but that unlink call operates on a different virtual filesystem than the OPFS VFS).
FossilOrigin-Name: 2ec7e09139a510b9fd29e4c97283b20740a00f369193c6fecbb734f187e81b48
Diffstat (limited to 'ext/wasm/api/sqlite3-api-opfs.js')
-rw-r--r--ext/wasm/api/sqlite3-api-opfs.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/wasm/api/sqlite3-api-opfs.js b/ext/wasm/api/sqlite3-api-opfs.js
index e0554e8c0..62aad0c4b 100644
--- a/ext/wasm/api/sqlite3-api-opfs.js
+++ b/ext/wasm/api/sqlite3-api-opfs.js
@@ -560,13 +560,13 @@ sqlite3.installOpfsVfs = function callee(asyncProxyUri = callee.defaultProxyUri)
Returns true if the deletion succeeded and fails if it fails,
but cannot report the nature of the failure.
*/
- opfsUtil.deleteEntry = function(fsEntryName,recursive){
+ opfsUtil.deleteEntry = function(fsEntryName,recursive=false){
return 0===opRun('xDelete', {filename:fsEntryName, recursive});
};
/**
Exactly like deleteEntry() but runs asynchronously.
*/
- opfsUtil.deleteEntryAsync = async function(fsEntryName,recursive){
+ opfsUtil.deleteEntryAsync = async function(fsEntryName,recursive=false){
wMsg('xDeleteNoWait', {filename: fsEntryName, recursive});
};
/**
@@ -682,7 +682,7 @@ sqlite3.installOpfsVfs = function callee(asyncProxyUri = callee.defaultProxyUri)
so we now know that the state object is no longer subject to
being copied by a pending postMessage() call.*/
try {
- const rc = capi.sqlite3_vfs_register(opfsVfs.pointer, opfsVfs.$zName);
+ const rc = capi.sqlite3_vfs_register(opfsVfs.pointer, 0);
if(rc){
opfsVfs.dispose();
toss("sqlite3_vfs_register(OPFS) failed with rc",rc);