aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-opfs.js
Commit message (Collapse)AuthorAge
* Add sqlite3_wasm_vfs_create_file() to replace Emscripten's ↵stephan2022-11-02
| | | | | FS.createDataFile() in a (mostly) VFS-agnostic way. Add a test for worker1's export (to bytearray) support. Re-add worker1 open-from-bytearray using sqlite3_wasm_vfs_create_file() but it's untested (requires a new interactive test app or maybe reconsideration). FossilOrigin-Name: b35e1225c91a3cadc0d25af1e4e790237256d194990faa13190e343ed03e11c5
* Significant cleanups and expansion of the sqlite3.opfs utilities. Add ↵stephan2022-11-01
| | | | | oo1.DB.dbVfsName(). Add VFS name to worker1:open's arguments and result. FossilOrigin-Name: 86a341d7e061f946b39e8647ddd4743013b851b33ae9e6e755d8dbc53fba5286
* Internal tweaks to the OPFS VFS result codes.stephan2022-10-31
| | | FossilOrigin-Name: 32e1a2d2eb8738ae1635e413829f6cf7f64c63d2a86b72940a573de89948e529
* Move the sqlite3.capi.wasm namespace to sqlite3.wasm. This causes a tiny bit ↵stephan2022-10-29
| | | | | of naming confusion with the sqlite3.wasm *file*, but seems to make more sense than having it as a sub-namespace of capi. FossilOrigin-Name: 3f16eb18d6186ca972fca952ccac18649e7a905213f589e53c0c9333e695448d
* Minor sqlite3.oo1 API reorg prompted by documenting.stephan2022-10-28
| | | FossilOrigin-Name: 55237924ca363c5a3e0f8c82620eb6626a98311615866197375a86876b9da3a1
* Minor cleanups and doc improvements in the OPFS sqlite3_vfs proxy.stephan2022-10-25
| | | FossilOrigin-Name: 48645f7bcacf81c4149f26d20ee1752fbe93a02f96b85bd7e28bfa49322137e5
* Apply considerable acrobatics to get the JS/WASM deliverables building to ↵stephan2022-10-19
| | | | | and loadable from a directory other than the one which contains the app-level code. Requires an only-slightly-leaky abstraction of passing a URL argument when loading sqlite3.js but provides much greater flexibility in where the JS/WASM files are located. FossilOrigin-Name: 6d468dab9eb84d4548f68014959f02fe4f66455472ff24fe729382bb2972e3d1
* Minor cleaups in the post-init async phase of sqlite3 module initialization.stephan2022-10-09
| | | FossilOrigin-Name: 2e024a6b533524b7732cea8aa27b16363e17b4c32731ddf31085e91fc728c1af
* Replace time-based auto-unlock of opfs sync handles with lock ↵stephan2022-10-04
| | | | | acquisition/release via sqlite3_io_methods::xLock/xUnlock(). FossilOrigin-Name: 2625b7cfe1640c1d7e779ec1f37db970541598c0dc3e22e5eecf3c772d95ad40
* Tweaks to the opfs async wait/relinquish times.stephan2022-10-04
| | | FossilOrigin-Name: 35f33c23e5849de1c43c4499ee0a7fa11d26ae34949c1e820c3fa8e8873f9c2b
* OPFS async proxy: add a wait-and-retry policy to the get-sync-handle step to ↵stephan2022-10-04
| | | | | help account for cross-tab locking. FossilOrigin-Name: 45c48c63d311052105d102189208495b2b53fa3c4174884ecf63b757aa4016e5
* Add a test/debug mechanism to shut down the OPFS async listener so that it ↵stephan2022-10-04
| | | | | can be inspected (it normally can't be because its tight event-listening loop ties up the thread) and then restarted. FossilOrigin-Name: 7d0bcff4e9b899cd25b393b9f0a02c5dcee2e229f0a0fa01719c7dcd7dcbe7c1
* Export sqlite3_trace_v2() to wasm and use it to ensure that the new per-VFS ↵stephan2022-10-03
| | | | | post-open SQL support in the DB ctor works. Default opfs vfs to journal_mode=truncate, as it's faster in that mode. Add 't' DB open-mode flag to enable SQL tracing to console.log(). FossilOrigin-Name: 508f7f6d63e52f61fae5abe817579a4e130fa7fbd18733d741d521a5bdabb7ce
* Add oo1.JsStorageDb() as a convenience wrapper for oo1.DB(...,'kvvfs'). ↵stephan2022-09-30
| | | | | Minor doc cleanups. FossilOrigin-Name: 8a7998709f859a562cf6829485cb9921f8823af0efabe003741348ab1169fb89
* Comment the -O2 wasm builds as being broken (mysteriously missing JS bits).stephan2022-09-27
| | | FossilOrigin-Name: f61475ef8244fd1f6553eca9cc2317e5de2cc04443e24afb7b91ebd3fc1bd402
* WASM API renaming. Reworked JS API bootstrap's async post-init into a ↵stephan2022-09-27
| | | | | generic mechanism, no longer OPFS-specific. FossilOrigin-Name: c42a8cb090cad1108dfd6be574202d744c59e053b505bc4c17252dc6b65d26bf
* wasm/js: rename /persistent to /opfs to account for potential future ↵stephan2022-09-27
| | | | | persistent storage options. Minor flag-handling cleanups in the speedtest1 pages. Minor API tweaks in oo1. FossilOrigin-Name: 4dc972a3656b2a9ec915bfb3f653136560c753ce4024c3f0d0d0c28f66db7a0a
* Fiddle: replace db export routine with a C-side one which works for both ↵stephan2022-09-26
| | | | | Emscripten FS-hosted and OPFS-hosted db files. Minor code-adjacent cleanups. FossilOrigin-Name: 3579a8d6f1f6cd3cd8aad9949536870c5fe7bae8c1778f700dd85d763e266b94
* Get fiddle db export working for OPFS VFS. Add root dir handle to the main ↵stephan2022-09-26
| | | | | OPFS VFS worker to enable creation of certain utility functions without delegating to the async worker. Add sqlite3.capi.sqlite3_wasm_rc_str() to map integer result codes back to their SQLITE_xxx counterparts. Minor doc touchups. FossilOrigin-Name: 9b2244e1c8a40efe6547094a1b57acc8f2173145a8731abb0e36268ce0a8ef41
* Reworked out the OPFS async proxy metrics are fetched so that they play more ↵stephan2022-09-24
| | | | | nicely with the tight event-polling loop. FossilOrigin-Name: ef503ced5c2ca842be9aea9ef13719a378ed3020e884032db09afee1b8eba0a1
* Correct mistyped --shrink-memory flag in speedtest1-worker. Minor OPFS proxy ↵stephan2022-09-21
| | | | | cleanups. FossilOrigin-Name: 86e2b55ec9483fa5add51a479c6509d73461f1ac6fca5d49e057b1c66f4314d2
* Doc cleanups and additions. Add a way for the OPFS async runner to propagate ↵stephan2022-09-21
| | | | | exception text to the calling thread. FossilOrigin-Name: 5c5e80652825cf883e6c17809cb98f2bf17d5feac2d263f6f492479154730dab
* Correct a too-strict is-opfs-available check.stephan2022-09-20
| | | FossilOrigin-Name: 1b5f1b4a6c1457f98c258459e23e321fc59793de298fecb84031b87f02156cd5
* Speed up de/serialization of func args and return values in the OPFS VFS proxy.stephan2022-09-20
| | | FossilOrigin-Name: 5bf235bbe035e4ace7a54851e190742528af6b4266328a1b8bbb9fb3dd7f2118
* OPFS proxy: remove one sanity-checking-only level of proxy function to shave ↵stephan2022-09-20
| | | | | off a few microseconds. FossilOrigin-Name: b534831f3efb8910a17e29956e3e87cc80055ea66e15dbef992b6a556ff042f8
* Remove extraneous result-code SAB slots. Doc additions.stephan2022-09-20
| | | FossilOrigin-Name: 88de20712bbe3e11ea74af95edc34e9ab9f346f9aa0a30931e5a9e1f96ce57b0
* An alternative messaging strategy for the OPFS VFS proxy which uses only ↵stephan2022-09-20
| | | | | SharedArrayBuffer and Atomics, instead of worker messages, for communication (only the initial one-time handshake during initialization uses worker messages). It runs speedtest1 approx. 15-20% faster but still 20-ish% slower than WASMFS. FossilOrigin-Name: a83ee3082d89439ea3ad5737e63e25bebb0f91895aca006ce5fecf5b93a2651a
* OPFS VFS: further internal refactoring towards experimenting with a new ↵stephan2022-09-20
| | | | | comms model. FossilOrigin-Name: 5ca412ced24b4e3af5f467e710a597ed440badf7b8335346aade11d3cad3d1a1
* OPFS VFS: moved i/o buffer from per-file to the VFS, and related ↵stephan2022-09-20
| | | | | refactoring, in prep for experimentation with a new inter-worker comms model. FossilOrigin-Name: d4d63e4580ad8d497310608175308c03c517e051d7865cb66aa0b10356612d7d
* Further metrics and buffer-copy optimizations in the OPFS proxy, but with ↵stephan2022-09-19
| | | | | little effect. FossilOrigin-Name: d1f1fe6f1c60640f7770dfb9245c459a09b8d24ec2ddf664dff77c810bd51f96
* Cut the speedtest1 runtime of the OPFS VFS proxy by approximately 3/4ths via ↵stephan2022-09-19
| | | | | xRead/xWrite buffer-copying optimizations. Still slower than the WASMFS impl by approx. 1/5th. FossilOrigin-Name: fb7f287310d74a3e236125ae9c49b859f9263c29ae85161c1bcf9dd0778d8a51
* Add sqlite3_web_vfs_list() to JS API. Corrected OPFS VFS's registering ↵stephan2022-09-19
| | | | | itself as the default VFS. speedtest1-worker now uses the xDelete() of both the default VFS and OPFS, to avoid that it starts up with a persistent OPFS test db (the native app calls unlink(), but that unlink call operates on a different virtual filesystem than the OPFS VFS). FossilOrigin-Name: 2ec7e09139a510b9fd29e4c97283b20740a00f369193c6fecbb734f187e81b48
* Generic cleanups in the OPFS VFS proxies.stephan2022-09-19
| | | FossilOrigin-Name: 7d5f6adc3b964413fc96ad8d2735312c3e58348024cabdd2099682cbf696eaf7
* Correct OPFS VFS xRead() to copy the result buffer if the result code is ↵stephan2022-09-19
| | | | | SQLITE_IOERR_SHORT_READ. FossilOrigin-Name: 56668f9902c6e896b6c63621a444444c6f58ee20f88a5feae97f1699be35892d
* Replace OPFS VFS xSleep() impl with a more efficient one (no Worker ↵stephan2022-09-19
| | | | | round-trip needed). FossilOrigin-Name: b9773f164878b0a1b7c88cc7a6d1374ea95f64920065e8b2b178a1afffd82fe5
* Numerous cleanups in the JS bits. Removed some now-defunct wasm test files. ↵stephan2022-09-18
| | | | | Expose sqlite3.opfs object containing various OPFS-specific utilities. FossilOrigin-Name: 26e625d05d9820033b23536f18ad3ddc59ed712ad507d4b0c7fe88abd15d2be8
* Move the OPFS VFS bits back into api/sqlite3-api-opfs.js. Refactor the OPFS ↵stephan2022-09-18
| | | | | VFS init process to use a Promise-returning function which the client must call, as that eliminates any uncertainty about when the VFS (necessarily activated asynchronously) actually becomes available to the client. FossilOrigin-Name: 1c660970d0f62bcfd6e698a72b050d99972a1e39f45a5ac24194a190f8f78ab3
* Add initial bits of an experimental async-impl-via-synchronous-interface ↵stephan2022-09-17
| | | | | proxy intended to marshal OPFS via sqlite3_vfs API. FossilOrigin-Name: 38da059b472415da52f57de7332fbeb8a91e3add1f4be3ff9c1924b52672f77c
* Refactor JS API amalgamation such that the bootstrapping/configuration is ↵stephan2022-08-22
| | | | | deferred until the whole amalgamation is available, to facilitate providing clients with a way to initialize the API with their own config (noting that we're still one small level of refactoring away from being able to actually do that). FossilOrigin-Name: 9dbe9a6aecec43b51057375ef1d2d632db0d17eac8b7552c20cc91fc2f1a55d1
* wasm: corrected (in as-yet unused code) a flags check.stephan2022-08-12
| | | FossilOrigin-Name: 06b6113783dd81252a5dd125e1cddb52a9d4e387c74cfb3ba88475e47a31060a
* wasm opfs: error handling fix for an impossible-to-reach error case. Minor ↵stephan2022-08-10
| | | | | cosmetic tweaks in the wasm JSON enum. FossilOrigin-Name: 683a3b937e608a5ecaf7f63f054e8a63179d67c8b2348bf843e5e68f27a369f5
* wasm refactoring part 2 of (apparently) 2: moved ext/fiddle/... into ↵stephan2022-08-10
ext/wasm and restructured the core API-related parts of the JS/WASM considerably. FossilOrigin-Name: 27f9da4eaaff39d1d58e9ffef7ddccf1e41b3726914f754b920e3e1fb572cba6