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

Fiddle: replace db export routine with a C-side one which works for both Emscripten FS-hosted and OPFS-hosted db files. Minor code-adjacent cleanups.

FossilOrigin-Name: 3579a8d6f1f6cd3cd8aad9949536870c5fe7bae8c1778f700dd85d763e266b94
This commit is contained in:
stephan
2022-09-26 13:55:10 +00:00
parent 1f095d482d
commit 278d3faf1f
9 changed files with 149 additions and 139 deletions

View File

@ -637,7 +637,7 @@ sqlite3.installOpfsVfs = function callee(asyncProxyUri = callee.defaultProxyUri)
const rc = opRun('xFileSize', pFile);
if(0==rc){
const sz = state.s11n.deserialize()[0];
wasm.setMemValue(pSz64, BigInt(sz), 'i64');
wasm.setMemValue(pSz64, sz, 'i64');
}
mTimeEnd();
return rc;
@ -820,10 +820,12 @@ sqlite3.installOpfsVfs = function callee(asyncProxyUri = callee.defaultProxyUri)
}
/* Install the vfs/io_methods into their C-level shared instances... */
let inst = installMethod(opfsIoMethods);
for(let k of Object.keys(ioSyncWrappers)) inst(k, ioSyncWrappers[k]);
inst = installMethod(opfsVfs);
for(let k of Object.keys(vfsSyncWrappers)) inst(k, vfsSyncWrappers[k]);
for(let k of Object.keys(ioSyncWrappers)){
installMethod(opfsIoMethods, k, ioSyncWrappers[k]);
}
for(let k of Object.keys(vfsSyncWrappers)){
installMethod(opfsVfs, k, vfsSyncWrappers[k]);
}
/**
Syncronously deletes the given OPFS filesystem entry, ignoring
@ -831,7 +833,7 @@ sqlite3.installOpfsVfs = function callee(asyncProxyUri = callee.defaultProxyUri)
directory", the given name must be an absolute path. If the 2nd
argument is truthy, deletion is recursive (use with caution!).
Returns true if the deletion succeeded and fails if it fails,
Returns true if the deletion succeeded and false if it fails,
but cannot report the nature of the failure.
*/
opfsUtil.deleteEntry = function(fsEntryName,recursive=false){