Back to Libsql

sqlite3 WASM Testing Page Index

libsql-sqlite3/ext/wasm/index.html

0.21.93.8 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: Core unit and regression tests for the various APIs and surrounding utility code.
    • tester1-worker: same thing but running in a Worker.
    • tester1-esm: same as tester1 but loads sqlite3 in the main thread via an ES6 module.
    • tester1-worker?esm: same as tester1-esm but loads a Worker Module which then loads the sqlite3 API via an ES6 module. Note that 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.
  • speedtest1 ports (sqlite3's primary benchmarking tool)...

  • The obligatory "misc." category...

  • 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.