1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Remove some dead JS code and update some JS docs.

FossilOrigin-Name: 6935ac71bad3d36cc519f0325ae4447a674f257309d020cdc0741160fcce0580
This commit is contained in:
stephan
2024-06-11 17:04:43 +00:00
parent cf2710e0b6
commit e15d5de0a6
4 changed files with 21 additions and 33 deletions

View File

@@ -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 = {