Back to Sqlcipher

sqlite3 WASM Testing Page Index

ext/wasm/index.html

4.15.05.2 KB
Original Source

Below is the list of test pages for the sqlite3 WASM builds. All of them require that this directory have been "make"d first. The intent is that this page be run using:

althttpd -enable-sab -page index.html

and the individual tests be started in their own tab. Warnings and Caveats:

  • All of these pages must be served via an HTTP server. Browsers do not support loading WASM files via file:// URLs.
  • Any OPFS-related pages or tests require:
    • An OPFS-capable browser released after February 2023. Some tests will work with Chromium-based browsers going back to around v102.
    • That the web server emit the so-called COOP and COEP headers. althttpd requires the -enable-sab flag for that.

The tests and demos...

  • Core-most tests

    • tester1 (32-bit64-bit): Core unit and regression tests for the various APIs and surrounding utility code.
    • tester1-esm (32-bit64-bit): same as tester1 but loads sqlite3 in the main thread via an ES6 module.
    • tester1-worker (32-bit64-bit): same thing but running in a Worker.
    • tester1-worker ESM (32-bit64-bit): same as tester1-worker but loads a Worker Module which then loads the sqlite3 API via an ES6 module. Not all browsers permit loading modules in Worker threads.
  • High-level apps and demos...

    • fiddle is an HTML front-end to a wasm build of the sqlite3 shell.
    • demo-123 provides a no-nonsense example of adding sqlite3 support to a web page in the UI thread.
    • demo-123-worker is the same as demo-123 but loads and runs sqlite3 from a Worker thread.
    • demo-jsstorage: very basic demo of using the key-value VFS for storing a persistent db in JS localStorage or sessionStorage.
    • demo-worker1: Worker-based wrapper of the OO API #1. Its Promise-based wrapper is significantly easier to use, however.
    • demo-worker1-promiser: a demo of the Promise-based wrapper of the Worker1 API.
    • demo-worker1-promiser-esm: same as the previous demo except loads the promiser from an ESM module.
  • speedtest1 ports (sqlite3's primary benchmarking tool)...

    • speedtest1 (32-bit, 64-bit): a main-thread WASM build of speedtest1.
    • speedtest1?vfs=kvvfs (32-bit, 64-bit): speedtest1 with the kvvfs.
    • speedtest1-worker (32-bit, 64-bit): an interactive Worker-thread variant of speedtest1.
    • speedtest1-worker?vfs=kvvfs (32-bit, 64-bit): speedtest1-worker with the kvvfs VFS preselected and configured for a moderate workload.
    • speedtest1-worker?vfs=opfs (32-bit, 64-bit): speedtest1-worker with the OPFS VFS preselected and configured for a moderate workload.
    • speedtest1-worker?vfs=opfs-wl (32-bit, 64-bit): speedtest1-worker with the OPFS Web Locks VFS preselected and configured for a moderate workload.
    • speedtest1-worker?vfs=opfs-sahpool (32-bit, 64-bit): speedtest1-worker with the OPFS-SAHPOOL VFS preselected and configured for a moderate workload.
  • The obligatory "misc." category...

    • module-symbols gives a high-level overview of the symbols exposed by the JS module.
    • test-opfs-vfs (same with verbose output and sanity-checking tests) is an sqlite3_vfs OPFS proxy using SharedArrayBuffer and the Atomics APIs to regulate communication between the synchronous sqlite3_vfs interface and the async OPFS impl.
    • OPFS concurrency tests using multiple workers.
    • OPFS SAHPool cooperative semi-concurrency demonstrates usage of the OPFS SAHPool VFS's "pause" feature to coordinate access to a database.
    • SQLTester is another testing tool for the library but making use of it requires tests from an external, proprietary project. Despite not being useful to the general public, a link to it is in this list so that its developer has easy access to it.
  • WASMFS -specific tests which require that the WASMFS build is available on this server (it is not by default) and that this server emits the COOP/COEP headers.