aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2025-01-31 12:39:07 +0000
committerstephan <stephan@noemail.net>2025-01-31 12:39:07 +0000
commitd4bfa3465e78cd852506e9c28a733c45d9eec32e (patch)
tree83ca5b33ba9ade8933147757d12687ebe79794b4 /ext/wasm
parentcb46f1bb95ed8677e85207be7f667b0020d1f200 (diff)
parentefbf4815411adc7c63f7caf49c5f60cb6cccaaca (diff)
downloadsqlite-d4bfa3465e78cd852506e9c28a733c45d9eec32e.tar.gz
sqlite-d4bfa3465e78cd852506e9c28a733c45d9eec32e.zip
Merge trunk into opfs-sahpool-pause branch.
FossilOrigin-Name: 775a547eca2b0b3dbb6c03990236128a095cc34d28caec44b9a5072510c75b63
Diffstat (limited to 'ext/wasm')
-rw-r--r--ext/wasm/README-dist.txt12
-rw-r--r--ext/wasm/README.md9
-rw-r--r--ext/wasm/api/README.md24
3 files changed, 27 insertions, 18 deletions
diff --git a/ext/wasm/README-dist.txt b/ext/wasm/README-dist.txt
index 6656a2072..4a527fc5e 100644
--- a/ext/wasm/README-dist.txt
+++ b/ext/wasm/README-dist.txt
@@ -31,16 +31,20 @@ build:
use of and is not demonstrated here.
Browsers will not serve WASM files from file:// URLs, so the test and
-demonstration apps require a web server and that server must include
-the following headers in its response when serving the files:
+demonstration apps require a web server and that server must, for the
+OPFS[^1]-related features, include the following headers in its response
+when serving the files:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
-The core library will function without those headers but certain
-features, most notably OPFS storage, will not be available.
+Most functionality will work without those headers but the OPFS[^1]
+storage capability will not be available without them.
One simple way to get the demo apps up and running on Unix-style
systems is to install althttpd (https://sqlite.org/althttpd) and run:
althttpd --enable-sab --page index.html
+
+
+[^1]: https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system
diff --git a/ext/wasm/README.md b/ext/wasm/README.md
index 21330f0eb..c41e54bd2 100644
--- a/ext/wasm/README.md
+++ b/ext/wasm/README.md
@@ -35,7 +35,7 @@ after upgrading it! Our build process makes no guarantees about which
Emscripten version(s) will or won't work, but it's important that
production builds are built using a compatible version. During active
development, the EMSDK is frequently updated, the goal being to keep
-sqlite3.wasm working with "the latest" EMSDK.)
+`sqlite3.wasm` working with "the latest" EMSDK.)
The SQLite configure script will search for the EMSDK. One way
to ensure that it finds it is:
@@ -95,14 +95,14 @@ $ make httpd
That will open the system's browser and visit the index page, from
which (almost) all of the test and demo applications can be accessed.
(`ext/wasm/SQLTester` is not listed in that page because it's only of
-real utility when it's used in conjunction with the proprietary test
-suite, which most users don't have access to.)
+real utility when it's used in conjunction with the project's
+proprietary test suite, which most users don't have access to.)
Note that when serving this app via [althttpd][], it must be a version
from 2022-09-26 or newer so that it recognizes the `--enable-sab`
flag, which causes althttpd to emit two HTTP response headers which
are required to enable JavaScript's `SharedArrayBuffer` and `Atomics`
-APIs. Those APIs are required in order to enable the OPFS-related
+APIs. Those APIs are required in order to enable the [OPFS][]-related
features in the apps which use them.
# Testing on a remote machine that is accessed via SSH
@@ -129,3 +129,4 @@ be tunneled using SSH.
[emscripten]: https://emscripten.org
[althttpd]: https://sqlite.org/althttpd
[SharedArrayBuffer]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
+[OPFS]: https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system
diff --git a/ext/wasm/api/README.md b/ext/wasm/api/README.md
index ebd4aaacb..ce7e58ebe 100644
--- a/ext/wasm/api/README.md
+++ b/ext/wasm/api/README.md
@@ -85,17 +85,18 @@ browser client:
Installs the `sqlite3.vtab` namespace, which contain helpers for use
by downstream code which creates `sqlite3_module` implementations.
- **`sqlite3-vfs-opfs.c-pp.js`**\
- is an sqlite3 VFS implementation which supports the Origin-Private
- FileSystem (OPFS) as a storage layer to provide persistent storage
- for database files in a browser. It requires...
+ is an sqlite3 VFS implementation which supports the [Origin-Private
+ FileSystem (OPFS)][OPFS] as a storage layer to provide persistent
+ storage for database files in a browser. It requires...
- **`sqlite3-opfs-async-proxy.js`**\
- is the asynchronous backend part of the OPFS proxy. It speaks
- directly to the (async) OPFS API and channels those results back
- to its synchronous counterpart. This file, because it must be
- started in its own Worker, is not part of the amalgamation.
+ is the asynchronous backend part of the [OPFS][] proxy. It
+ speaks directly to the (async) OPFS API and channels those
+ results back to its synchronous counterpart. This file, because
+ it must be started in its own Worker, is not part of the
+ amalgamation.
- **`sqlite3-vfs-opfs-sahpool.c-pp.js`**\
- is another sqlite3 VFS supporting the OPFS, but uses a completely
- different approach that the above-listed one.
+ is another sqlite3 VFS supporting the [OPFS][], but uses a
+ completely different approach that the above-listed one.
- **`sqlite3-api-cleanup.js`**\
The previous files do not immediately extend the library. Instead
they add callback functions to be called during its
@@ -152,7 +153,7 @@ into the build-generated `sqlite3.js` along with `sqlite3-api.js`.
flag. This file overwrites the Emscripten-installed
`sqlite3InitModule()` function with one which, after the module is
loaded, also initializes the asynchronous parts of the sqlite3
- module. For example, the OPFS VFS support.
+ module. For example, the [OPFS][] VFS support.
<a id='c-pp'></a>
Preprocessing of Source Files
@@ -164,3 +165,6 @@ builds. The preprocessor application itself is in
[`c-pp.c`](/file/ext/wasm/c-pp.c) and the complete technical details
of such preprocessing are maintained in
[`GNUMakefile`](/file/ext/wasm/GNUmakefile).
+
+
+[OPFS]: https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system