mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Rename several demo/test files and include more of them in the end-user dist archive.
FossilOrigin-Name: 9c85835f6f50eb3b1a2b89c817816335743f04440c48bfa05aa89ec519cc0d51
This commit is contained in:
@ -106,7 +106,7 @@
|
||||
|
||||
```
|
||||
{
|
||||
type: 'error',
|
||||
type: "error",
|
||||
|
||||
messageId: ...as above...,
|
||||
|
||||
@ -150,7 +150,7 @@
|
||||
|
||||
```
|
||||
{
|
||||
type: 'config',
|
||||
type: "config-get",
|
||||
messageId: ...as above...,
|
||||
result: {
|
||||
|
||||
@ -167,7 +167,7 @@
|
||||
the non-WASMFS OPFS VFS to open a database via a URI-style
|
||||
db filename.
|
||||
|
||||
vfses: result of sqlite3.capi.sqlite3_web_vfs_list()
|
||||
vfsList: result of sqlite3.capi.sqlite3_web_vfs_list()
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -196,7 +196,7 @@
|
||||
|
||||
```
|
||||
{
|
||||
type: 'open',
|
||||
type: "open",
|
||||
messageId: ...as above...,
|
||||
result: {
|
||||
filename: db filename, possibly differing from the input.
|
||||
@ -205,7 +205,7 @@
|
||||
envelope to other calls in this API to tell them which db to
|
||||
use. If it is not provided to future calls, they will default to
|
||||
operating on the first-opened db. This property is, for API
|
||||
consistency's sake, also part of the contaning message envelope.
|
||||
consistency's sake, also part of the containing message envelope.
|
||||
Only the `open` operation includes it in the `result` property.
|
||||
|
||||
persistent: true if the given filename resides in the
|
||||
@ -237,7 +237,7 @@
|
||||
|
||||
```
|
||||
{
|
||||
type: 'close',
|
||||
type: "close",
|
||||
messageId: ...as above...,
|
||||
result: {
|
||||
|
||||
@ -269,7 +269,7 @@
|
||||
|
||||
```
|
||||
{
|
||||
type: 'exec',
|
||||
type: "exec",
|
||||
messageId: ...as above...,
|
||||
dbId: ...as above...
|
||||
result: {
|
||||
@ -370,8 +370,7 @@ sqlite3.initWorker1API = function(){
|
||||
if(alsoUnlink && filename){
|
||||
/* This isn't necessarily correct: the db might be using a
|
||||
VFS other than the default. How do we best resolve this
|
||||
without having to special-case the kvvfs and opfs
|
||||
VFSes? */
|
||||
without having to special-case the opfs VFSes? */
|
||||
sqlite3.capi.wasm.sqlite3_wasm_vfs_unlink(filename);
|
||||
}
|
||||
}
|
||||
@ -524,7 +523,7 @@ sqlite3.initWorker1API = function(){
|
||||
});
|
||||
rc.wasmfsOpfsEnabled = !!sqlite3.capi.sqlite3_wasmfs_opfs_dir();
|
||||
rc.version = sqlite3.version;
|
||||
rc.vfses = sqlite3.capi.sqlite3_web_vfs_list();
|
||||
rc.vfsList = sqlite3.capi.sqlite3_web_vfs_list();
|
||||
return rc;
|
||||
},
|
||||
|
||||
|
@ -70,8 +70,8 @@
|
||||
message. The second expects an object in the form {type:...,
|
||||
args:...} plus any other properties the client cares to set. This
|
||||
function will always set the `messageId` property on the object,
|
||||
even if it's already set, and will set the `dbId` property to
|
||||
`config.dbId` if it is _not_ set in the message object.
|
||||
even if it's already set, and will set the `dbId` property to the
|
||||
current database ID if it is _not_ set in the message object.
|
||||
|
||||
The function throws on error.
|
||||
|
||||
|
@ -26,11 +26,8 @@
|
||||
Worker constructor and then listen for an event in the form shown
|
||||
above in order to know when the module has completed initialization.
|
||||
|
||||
This file accepts a couple of URL arguments to adjust how it loads
|
||||
sqlite3.js:
|
||||
This file accepts a URL arguments to adjust how it loads sqlite3.js:
|
||||
|
||||
- `sqlite3.js`, if set, is used as the URI to `sqlite3.js` and it
|
||||
may contain path elements, e.g. `sqlite3.js=foo/bar/my-sqlite3.js`.
|
||||
- `sqlite3.dir`, if set, treats the given directory name as the
|
||||
directory from which `sqlite3.js` will be loaded.
|
||||
|
||||
@ -40,9 +37,7 @@
|
||||
(()=>{
|
||||
const urlParams = new URL(self.location.href).searchParams;
|
||||
let theJs = 'sqlite3.js';
|
||||
if(urlParams.has('sqlite3.js')){
|
||||
theJs = urlParams.get('sqlite3.js');
|
||||
}else if(urlParams.has('sqlite3.dir')){
|
||||
if(urlParams.has('sqlite3.dir')){
|
||||
theJs = urlParams.get('sqlite3.dir') + '/' + theJs;
|
||||
}
|
||||
importScripts(theJs);
|
||||
|
@ -44,6 +44,6 @@
|
||||
</style>
|
||||
<script src="jswasm/sqlite3.js"></script>
|
||||
<script src="common/SqliteTestUtil.js"></script>
|
||||
<script src="demo-kvvfs1.js"></script>
|
||||
<script src="demo-jsstorage.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -29,6 +29,6 @@
|
||||
<div id='test-output'></div>
|
||||
<script src="common/SqliteTestUtil.js"></script>
|
||||
<script src="jswasm/sqlite3-worker1-promiser.js"></script>
|
||||
<script src="testing-worker1-promiser.js"></script>
|
||||
<script src="demo-worker1-promiser.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,3 +1,4 @@
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
@ -28,6 +29,6 @@
|
||||
<hr>
|
||||
<div id='test-output'></div>
|
||||
<script src="common/SqliteTestUtil.js"></script>
|
||||
<script src="testing2.js"></script>
|
||||
<script src="demo-worker1.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -13,7 +13,7 @@
|
||||
A basic test script for sqlite3-worker1.js.
|
||||
|
||||
Note that the wrapper interface demonstrated in
|
||||
testing-worker1-promiser.js is much easier to use from client code, as it
|
||||
demo-worker1-promiser.js is much easier to use from client code, as it
|
||||
lacks the message-passing acrobatics demonstrated in this file.
|
||||
*/
|
||||
'use strict';
|
@ -42,9 +42,14 @@ dist-dir.jswasm := $(dist-dir.top)/$(notdir $(dir.dout))
|
||||
dist-dir.common := $(dist-dir.top)/common
|
||||
dist.top.extras := \
|
||||
demo-123.html demo-123-worker.html demo-123.js \
|
||||
tester1.html tester1-worker.html tester1.js
|
||||
tester1.html tester1-worker.html tester1.js \
|
||||
demo-jsstorage.html demo-jsstorage.js \
|
||||
demo-worker1.html demo-worker1.js \
|
||||
demo-worker1-promiser.html demo-worker1-promiser.js
|
||||
dist.jswasm.extras := $(sqlite3-api.ext.jses) $(sqlite3.wasm)
|
||||
dist.common.extras := $(wildcard $(dir.common)/*.css)
|
||||
dist.common.extras := \
|
||||
$(wildcard $(dir.common)/*.css) \
|
||||
$(dir.common)/SqliteTestUtil.js
|
||||
|
||||
.PHONY: dist
|
||||
########################################################################
|
||||
|
@ -55,10 +55,10 @@
|
||||
regression tests for the various APIs and surrounding
|
||||
utility code.</li>
|
||||
<li><a href='tester1-worker.html'>tester1-worker</a>: same thing
|
||||
but running in a Worker.</li>
|
||||
but running in a Worker.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>High-level apps and demos...
|
||||
<li>Higher-level apps and demos...
|
||||
<ul>
|
||||
<li><a href='demo-123.html'>demo-123</a> provides a
|
||||
no-nonsense example of adding sqlite3 support to a web
|
||||
@ -66,6 +66,14 @@
|
||||
<li><a href='demo-123-worker.html'>demo-123-worker</a> is
|
||||
the same as <code>demo-123</code> but loads and runs
|
||||
sqlite3 from a Worker thread.</li>
|
||||
<li><a href='demo-jsstorage.html'>demo-jsstorage</a>: very basic
|
||||
demo of using the key-value VFS for storing a persistent db
|
||||
in JS <code>localStorage</code> or <code>sessionStorage</code>.</li>
|
||||
<li><a href='demo-worker1.html'>demo-worker1</a>:
|
||||
Worker-based wrapper of the OO API #1. Its Promise-based
|
||||
wrapper is significantly easier to use, however.</li>
|
||||
<li><a href='demo-worker1-promiser.html'>demo-worker1-promiser</a>:
|
||||
a demo of the Promise-based wrapper of the Worker1 API.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -59,9 +59,14 @@
|
||||
<li><a href='demo-123-worker.html'>demo-123-worker</a> is
|
||||
the same as <code>demo-123</code> but loads and runs
|
||||
sqlite3 from a Worker thread.</li>
|
||||
<li><a href='demo-kvvfs1.html'>demo-kvvfs1</a>: very basic
|
||||
<li><a href='demo-jsstorage.html'>demo-jsstorage</a>: very basic
|
||||
demo of using the key-value VFS for storing a persistent db
|
||||
in JS <code>localStorage</code> or <code>sessionStorage</code>.</li>
|
||||
<li><a href='demo-worker1.html'>demo-worker1</a>:
|
||||
Worker-based wrapper of the OO API #1. Its Promise-based
|
||||
wrapper is significantly easier to use, however.</li>
|
||||
<li><a href='demo-worker1-promiser.html'>demo-worker1-promiser</a>:
|
||||
a demo of the Promise-based wrapper of the Worker1 API.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>speedtest1 ports (sqlite3's primary benchmarking tool)...
|
||||
@ -77,9 +82,6 @@
|
||||
</li>
|
||||
<li>The obligatory "misc." category...
|
||||
<ul>
|
||||
<li><a href='testing2.html'>testing2</a>: Worker-based test of OO API #1.</li>
|
||||
<li><a href='testing-worker1-promiser.html'>testing-worker1-promiser</a>:
|
||||
tests for the Promise-based wrapper of the Worker-based API.</li>
|
||||
<li><a href='batch-runner.html'>batch-runner</a>: runs batches of SQL exported from speedtest1.</li>
|
||||
<!--li><a href='scratchpad-wasmfs-main.html'>scratchpad-wasmfs-main</a>:
|
||||
experimenting with WASMFS/OPFS-based persistence. Maintenance
|
||||
|
Reference in New Issue
Block a user