aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-opfs.js
Commit message (Collapse)AuthorAge
* Rename some OPFS JS files. Prevent JS bindings of sqlite3_uri_...() from ↵stephan2022-11-30
| | | | | performing JS-to-C-string argument conversion on their first argument, as doing so is specifically illegal. FossilOrigin-Name: 79832808de2cbdba140ed9e0558f1502b51d131ab4315265315922cda7b748cb
* Refactor a significant chunk of the OPFS sqlite3_vfs init code into ↵stephan2022-11-30
| | | | | sqlite3.VfsHelper, and internal-use-only API encapsulating code relevant to creating new VFSes in JS. Intended to assist in pending experimentation with an alternative OPFS VFS. FossilOrigin-Name: e25d7b080a807e35b32cb885ea75b384130e5c6e936dfef783c5b45d9bfe77d8
* sqlite3.oo1.OpfsDb: default to journal_mode=persist, as current tests show ↵stephan2022-11-29
| | | | | it to be marginally faster than truncate/delete in Chrome v109. Also increase default busy_timeout from 2 seconds to 3, admittedly on a whim. FossilOrigin-Name: d0c8fa30a31c691bc1be5e98d806eeb1e23a8fc6cd54d87e5c1b720aa936e707
* Minor internal cleanups and docs in the OPFS sqlite3_vfs.stephan2022-11-29
| | | FossilOrigin-Name: 61799b05ff232c2ac349169c27bfe7f8d9277366093b0c9dd2739828993b3066
* Internal restructuring of the OPFS sqlite3_vfs in order to facilitate ↵stephan2022-11-29
| | | | | certain experimentation and improve error reporting/hints if it cannot be activated. Deprecate the name sqlite3.opfs.OpfsDb, preferring sqlite3.oo1.OpfsDb for consistency with JsStorageDb and any future DB subclasses. FossilOrigin-Name: 0c5c51f4fb04a4b90c50ec9704cfea9a3fb7d7d0ee55c1b0d4476129188217a6
* Add an explicit warning about the current API-instability of the ↵stephan2022-11-29
| | | | | sqlite3.opfs namespace, which may need to be eliminated based on re-thinking of how the OPFS sqlite3_vfs is registered. Comment changes only - no code. FossilOrigin-Name: 0cb2fd14179397051a25d066256a553fc198656d5668c7010c016f2b8f495bf4
* More work on the OPFS concurrency testing app.stephan2022-11-24
| | | FossilOrigin-Name: c0458caca3508d5d252f9b5198bda4f51a5c1874540f014b17e409f2daab1706
* Add an experimental OPFS VFS-specific URI flag, opfs-unlock-asap, which ↵stephan2022-11-23
| | | | | tells the VFS to release implicit locks ASAP. This permits higher concurrency but hurts performance considerably. This may or may not be obsoleted by other concurrency-related experimentation. FossilOrigin-Name: d23c917013485ec2793125221f3936b05c39d6eca941629fb819b6b4aa714520
* Initial infrastructure for adding a mode to the OPFS VFS which causes ↵stephan2022-11-23
| | | | | implicit locks to be released ASAP, which increases concurrency at the cost of performance. FossilOrigin-Name: c5b7a9715a13b696ab3ee965aa0a310f59b65f07cecd72faa2e3504bfd8eb632
* Resolve missing SQLITE_LOCKED result code which triggered a new (since last ↵stephan2022-11-21
| | | | | checkin) exception in the OPFS VFS. Improve output of the OPFS contention tester app. FossilOrigin-Name: 2debbbca33bd4170a1dc4dbb5eb3e68523e51d289b06c551e5560ac4e32e433b
* Add test app for experimenting with multi-worker OPFS concurrency. Tweak ↵stephan2022-11-21
| | | | | OPFS VFS to significantly improve the otherwise "unfortunate" concurrency situation. FossilOrigin-Name: 96f76e7616f8157a342b9e1c42f7b1feab200d182268871a2b25f67d4ee2564c
* Minor cleanups in the ESM-related preprocessor filtering.stephan2022-11-20
| | | FossilOrigin-Name: 205884a273128bb666b496b659b4fa9f031ebdbbc1aa704fdeb4b7e015740098
* Add build of sqlite3.mjs (ES6 module), add a test app for it, and include it ↵stephan2022-11-19
| | | | | in the dist build. FossilOrigin-Name: 2e783670e10b59e67c14b0db7f4803b41790cc7730de221d54fa2d4483cfba33
* Replace use of cpp with the fit-to-purpose c-pp to avoid cpp's ↵stephan2022-11-18
| | | | | C-centric/JS-unfriendly quirks. FossilOrigin-Name: 49d70f071e918d5d095c807575bb7ce2b287a123261e789e938521b3b409429a
* Merge trunk into js-cpp branch.stephan2022-11-17
|\ | | | | FossilOrigin-Name: e047b33d1fb7d6a32e967f03f9952249cd2da4d21dc301fe92bd7baa0da5d6a9
| * Rework automatically acquired OPFS locks to be released during idle time. ↵stephan2022-11-10
| | | | | | | | | | This eliminates the performance hit reported in [46304ba057707c]. FossilOrigin-Name: a7fe91afca473fe55c983bc81d214df4ef3699863c7423fa4b6b9cde23d6a3b4
* | Experimentally use clang's C preprocessor to filter #ifdef's out of the ↵stephan2022-11-03
|/ | | | | generated sqlite3-api.js, the goal being to see if we can feasibly use cpp to include ES6 module-specific code in the main code base and conditionally filter it out. FossilOrigin-Name: 718a6d371e61359d73c8f80afdb248e3d9b4d8df4c4e5c122ac884344e31035b
* 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