xref: /sqlite-3.40.0/ext/wasm/index.html (revision 3d645484)
144a87f08Sstephan<!doctype html>
244a87f08Sstephan<html lang="en-us">
344a87f08Sstephan  <head>
444a87f08Sstephan    <meta charset="utf-8">
544a87f08Sstephan    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
644a87f08Sstephan    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
744a87f08Sstephan    <link rel="stylesheet" href="common/testing.css"/>
844a87f08Sstephan    <title>sqlite3 WASM Testing Page Index</title>
944a87f08Sstephan  </head>
1044a87f08Sstephan  <body>
1144a87f08Sstephan    <header id='titlebar'><span>sqlite3 WASM test pages</span></header>
1244a87f08Sstephan    <hr>
1344a87f08Sstephan    <div>Below is the list of test pages for the sqlite3 WASM
1444a87f08Sstephan      builds. All of them require that this directory have been
1544a87f08Sstephan      "make"d first. The intent is that <em>this</em> page be run
1644a87f08Sstephan      using:</div>
17*3d645484Sstephan    <blockquote><pre>althttpd -enable-sab -page index.html</pre></blockquote>
181f095d48Sstephan    <div>and the individual tests be started in their own tab.
191f095d48Sstephan      Warnings and Caveats:
2044a87f08Sstephan      <ul class='warning'>
2144a87f08Sstephan        <li>Some of these pages require that
221f095d48Sstephan          the web server emit the so-called
231f095d48Sstephan          <a href='https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy'>COOP</a>
241f095d48Sstephan          and
251f095d48Sstephan          <a href='https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy'>COEP</a>
26*3d645484Sstephan          headers. <a href='https://sqlite.org/althttpd'>althttpd</a> requires the
27*3d645484Sstephan          <code>-enable-sab</code> flag for that.
2844a87f08Sstephan        </li>
291f095d48Sstephan        <li>Any OPFS-related pages require very recent version of
301f095d48Sstephan          Chrome or Chromium (v102 at least, possibly newer). OPFS
311f095d48Sstephan          support in the other major browsers is pending. Development
321f095d48Sstephan          and testing is currently done against a dev-channel release
331f095d48Sstephan          of Chrome (v107 as of 2022-09-26).
341f095d48Sstephan        </li>
3544a87f08Sstephan        <li>Whether or not WASMFS/OPFS support is enabled on any given
3644a87f08Sstephan          page may depend on build-time options which are <em>off by
3744a87f08Sstephan          default</em> because they currently (as of 2022-09-08) break
381f095d48Sstephan          with Worker-based pages.
3944a87f08Sstephan        </li>
4044a87f08Sstephan      </ul>
4144a87f08Sstephan    </div>
421f095d48Sstephan    <div>The tests and demos...
4344a87f08Sstephan      <ul id='test-list'>
44171b168bSstephan        <li>High-level apps and demos...
45171b168bSstephan          <ul>
46ebe14230Sstephan            <li><a href='fiddle/fiddle.html'>fiddle</a> is an HTML front-end
47ebe14230Sstephan              to a wasm build of the sqlite3 shell.</li>
48ac51eb77Sstephan            <li><a href='demo-123.html'>demo-123</a> provides a
491f095d48Sstephan              no-nonsense example of adding sqlite3 support to a web
501f095d48Sstephan              page in the UI thread.</li>
511f095d48Sstephan            <li><a href='demo-123-worker.html'>demo-123-worker</a> is
521f095d48Sstephan              the same as <code>demo-123</code> but loads and runs
531f095d48Sstephan              sqlite3 from a Worker thread.</li>
54171b168bSstephan            <li><a href='demo-kvvfs1.html'>demo-kvvfs1</a>: very basic
551f095d48Sstephan              demo of using the key-value VFS for storing a persistent db
561f095d48Sstephan              in JS <code>localStorage</code> or <code>sessionStorage</code>.</li>
57171b168bSstephan          </ul>
58171b168bSstephan        </li>
59171b168bSstephan        <li>speedtest1 ports (sqlite3's primary benchmarking tool)...
60171b168bSstephan          <ul>
61171b168bSstephan            <li><a href='speedtest1.html'>speedtest1</a>: a main-thread WASM build of speedtest1.</li>
62*3d645484Sstephan            <li><a href='speedtest1-wasmfs.html?flags=--size,25'>speedtest1-wasmfs</a>: a variant of speedtest1 built solely for the wasmfs/opfs feature.</li>
63171b168bSstephan            <li><a href='speedtest1.html?vfs=kvvfs'>speedtest1-kvvfs</a>: speedtest1 with the kvvfs.</li>
64*3d645484Sstephan            <li><a href='speedtest1-worker.html?size=25'>speedtest1-worker</a>: an interactive Worker-thread variant of speedtest1.</li>
65171b168bSstephan            <li><a href='speedtest1-worker.html?vfs=opfs&size=25'>speedtest1-worker-opfs</a>: speedtest1-worker with the
66171b168bSstephan              OPFS VFS preselected and configured for a moderate workload.</li>
67171b168bSstephan          </ul>
68171b168bSstephan        </li>
69171b168bSstephan        <li>The obligatory "misc." category...
70171b168bSstephan          <ul>
7144a87f08Sstephan            <li><a href='testing1.html'>testing1</a>: sanity tests of the core APIs and surrounding utility code.</li>
7244a87f08Sstephan            <li><a href='testing2.html'>testing2</a>: Worker-based test of OO API #1.</li>
7344a87f08Sstephan            <li><a href='testing-worker1-promiser.html'>testing-worker1-promiser</a>:
7444a87f08Sstephan              tests for the Promise-based wrapper of the Worker-based API.</li>
7544a87f08Sstephan            <li><a href='batch-runner.html'>batch-runner</a>: runs batches of SQL exported from speedtest1.</li>
760117693fSstephan            <li><a href='scratchpad-wasmfs-main.html'>scratchpad-wasmfs-main</a>:
770117693fSstephan              experimenting with WASMFS/OPFS-based persistence. Maintenance
780117693fSstephan              reminder: we cannot currently (2022-09-15) load WASMFS in a
790117693fSstephan              worker due to an Emscripten limitation.</li>
800db30895Sstephan            <li><a href='test-opfs-vfs.html'>test-opfs-vfs</a>
810db30895Sstephan              (<a href='test-opfs-vfs.html?opfs-sanity-check&opfs-verbose'>same
820db30895Sstephan                with verbose output and sanity-checking tests</a>) is an
83132a87baSstephan              experiment in implementing a syncronous sqlite3 VFS proxy
840db30895Sstephan              for a fully asynchronous backend interface (namely OPFS),
850db30895Sstephan              using SharedArrayBuffer and the Atomics APIs to regulate
860db30895Sstephan              communication between the synchronous interface and the
870db30895Sstephan              async impl.
88132a87baSstephan            </li>
89171b168bSstephan          </ul>
90171b168bSstephan        </li>
9144a87f08Sstephan        <!--li><a href='x.html'></a></li-->
9244a87f08Sstephan      </ul>
9344a87f08Sstephan    </div>
9444a87f08Sstephan    <style>
9544a87f08Sstephan      #test-list { font-size: 120%; }
9644a87f08Sstephan    </style>
9744a87f08Sstephan    <script>//Assign a distinct target tab name for each test page...
9844a87f08Sstephan      document.querySelectorAll('a').forEach(function(e){
9944a87f08Sstephan          e.target = e.href;
10044a87f08Sstephan      });
10144a87f08Sstephan    </script>
10244a87f08Sstephan  </body>
10344a87f08Sstephan</html>
104