aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2024-06-11 17:04:43 +0000
committerstephan <stephan@noemail.net>2024-06-11 17:04:43 +0000
commite15d5de0a6e288dd2292b6ff3958cb4390bfe5a4 (patch)
tree0affba72d8479a08a5927f5126a0f2f4cf159482 /ext/wasm/api
parentcf2710e0b61dbe5abd3b0017905dfc5cb6c21d8d (diff)
downloadsqlite-e15d5de0a6e288dd2292b6ff3958cb4390bfe5a4.tar.gz
sqlite-e15d5de0a6e288dd2292b6ff3958cb4390bfe5a4.zip
Remove some dead JS code and update some JS docs.
FossilOrigin-Name: 6935ac71bad3d36cc519f0325ae4447a674f257309d020cdc0741160fcce0580
Diffstat (limited to 'ext/wasm/api')
-rw-r--r--ext/wasm/api/sqlite3-api-worker1.js7
-rw-r--r--ext/wasm/api/sqlite3-vfs-opfs.c-pp.js31
2 files changed, 13 insertions, 25 deletions
diff --git a/ext/wasm/api/sqlite3-api-worker1.js b/ext/wasm/api/sqlite3-api-worker1.js
index 2e597613e..991862545 100644
--- a/ext/wasm/api/sqlite3-api-worker1.js
+++ b/ext/wasm/api/sqlite3-api-worker1.js
@@ -571,7 +571,6 @@ sqlite3.initWorker1API = function(){
});
rc.version = sqlite3.version;
rc.vfsList = sqlite3.capi.sqlite3_js_vfs_list();
- rc.opfsEnabled = !!sqlite3.opfs;
return rc;
},
@@ -598,12 +597,6 @@ sqlite3.initWorker1API = function(){
toss: function(ev){
toss("Testing worker exception");
- },
-
- 'opfs-tree': async function(ev){
- if(!sqlite3.opfs) toss("OPFS support is unavailable.");
- const response = await sqlite3.opfs.treeList();
- return response;
}
}/*wMsgHandler*/;
diff --git a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
index 4c654c335..a2ad6ad3e 100644
--- a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
+++ b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
@@ -38,10 +38,6 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
Significant notes and limitations:
- - As of this writing, OPFS is still very much in flux and only
- available in bleeding-edge versions of Chrome (v102+, noting that
- that number will increase as the OPFS API matures).
-
- The OPFS features used here are only available in dedicated Worker
threads. This file tries to detect that case, resulting in a
rejected Promise if those features do not seem to be available.
@@ -62,15 +58,17 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
The argument may optionally be a plain object with the following
configuration options:
- - proxyUri: as described above
+ - proxyUri: name of the async proxy JS file.
- verbose (=2): an integer 0-3. 0 disables all logging, 1 enables
logging of errors. 2 enables logging of warnings and errors. 3
- additionally enables debugging info.
+ additionally enables debugging info. Logging is performed
+ via the sqlite3.config.{log|warn|error}() functions.
- - sanityChecks (=false): if true, some basic sanity tests are
- run on the OPFS VFS API after it's initialized, before the
- returned Promise resolves.
+ - sanityChecks (=false): if true, some basic sanity tests are run on
+ the OPFS VFS API after it's initialized, before the returned
+ Promise resolves. This is only intended for testing and
+ development of the VFS, not client-side use.
On success, the Promise resolves to the top-most sqlite3 namespace
object and that object gets a new object installed in its
@@ -994,7 +992,9 @@ const installOpfsVfs = function callee(options){
};
/**
Checks whether the given OPFS filesystem entry exists,
- returning true if it does, false if it doesn't.
+ returning true if it does, false if it doesn't or if an
+ exception is intercepted while trying to make the
+ determination.
*/
opfsUtil.entryExists = async function(fsEntryName){
try {
@@ -1110,9 +1110,9 @@ const installOpfsVfs = function callee(options){
};
/**
- Traverses the OPFS filesystem, calling a callback for each one.
- The argument may be either a callback function or an options object
- with any of the following properties:
+ Traverses the OPFS filesystem, calling a callback for each
+ entry. The argument may be either a callback function or an
+ options object with any of the following properties:
- `callback`: function which gets called for each filesystem
entry. It gets passed 3 arguments: 1) the
@@ -1142,11 +1142,6 @@ const installOpfsVfs = function callee(options){
but that promise has no specific meaning: the traversal it
performs is synchronous. The promise must be used to catch any
exceptions propagated by the callback, however.
-
- TODO: add an option which specifies whether to traverse
- depth-first or breadth-first. We currently do depth-first but
- an incremental file browsing widget would benefit more from
- breadth-first.
*/
opfsUtil.traverse = async function(opt){
const defaultOpt = {