1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

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
This commit is contained in:
stephan
2022-09-19 13:44:23 +00:00
parent b5ae85eca2
commit 0e0687ccfc
8 changed files with 44 additions and 25 deletions

View File

@ -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);