Commit Graph

1079 Commits

Author SHA1 Message Date
stephan
57d7a20ce7 Another nano-optimization in kvvfs v2.
FossilOrigin-Name: a9d60190d693504742a894918f145111908d7d6cb9e853ba7a2356529046372a
2026-02-27 06:33:28 +00:00
stephan
d22d0edc48 JS: slight performance improvements in KVVfsStorage.
FossilOrigin-Name: 56edf2addb155dbb60269fe563ecb5f6132672c6c61f6f9d18ebdff72111298d
2026-02-27 03:21:47 +00:00
stephan
9e395efec6 Fix a cse in the fiddle.debug build where it could not overwrite its read-only/generated index.html.
FossilOrigin-Name: 7adb2c0f438a97d377760436b1ac81fffab36e541a2b5ee733bfc7108e0180e5
2026-02-20 14:22:09 +00:00
stephan
de702aebb9 Fix a method name typo in test-only code which could hide the triggering error condition.
FossilOrigin-Name: b2c1a4184c3de5a26524906ba04ce6c9c80b27f8d89c40fde7bbc8f5a9f99e34
2026-02-08 12:13:19 +00:00
stephan
e45418c5f5 JS doc touchups.
FossilOrigin-Name: dcd22fd6d135892852358c8cfb5049dce4a1410dbc0f28cafc8b340f69350165
2026-02-08 05:08:30 +00:00
stephan
561e28b75b kvvfs fix for [https://github.com/sqlite/sqlite-wasm/issues/146|npm ticket #146]: use of a test-mode-only symbol in non-test runs leads to a null deref in xFileControl().
FossilOrigin-Name: 407724c4e80efdf93d885e95b5209a100a3f470fe0298138be57201f65f9817e
2026-01-30 06:37:34 +00:00
stephan
840199ee18 Fix speedtest1.wasm build regression introduced with Emscripten 5.0.0.
FossilOrigin-Name: 4733d351ec2376291f093ba8d2ba71d82c6f100c68dc860eee0532986c154e71
2026-01-26 10:53:24 +00:00
stephan
a5070d083c Expose SQLITE_UTF_ZT to WASM for completeness's sake, but the WASM build does not expose sqlite3_bind_text64() or sqlite3_result_text64() because it only supports UTF8 encoding, so ZT does not currently have a genuine use there.
FossilOrigin-Name: d931831ce9d2dea3730f33afc046e159ad886842114831a6bbe56d5b746ab0af
2026-01-24 01:17:06 +00:00
stephan
815905544d Tiny JS doc touchup.
FossilOrigin-Name: 6d9ec0a21a2b33a7bb3cf9c3677c9ef7a9738d318cd2d8159b33583b2bd4abec
2026-01-20 18:07:27 +00:00
stephan
e822005684 wasm: make pre-js.c-pp.js a no-op in bundler-friendly builds.
FossilOrigin-Name: 982a91abc0c97e7e785d3ba69a4d0516a899f4d6cd462027ebdf7115e577e8c3
2026-01-20 18:01:56 +00:00
stephan
bb56ddc4e3 wasm: a potential workaround for cases such as [forum:1eec339854c935bd|forum post 1eec339854c935bd], where client-local needs require overriding Emscripten config defaults (which we very intentionally do not document or support for reasons explained in that thread). This is untested because it requires a special-needs setup, but it doesn't break anything for run-of-the-mill cases.
FossilOrigin-Name: c8e6be9241e3e17898c451baad109b75dc8a97a91ff1e43c67a6c962b75af8f3
2026-01-20 17:10:22 +00:00
stephan
f4a613aa46 Minor doc updates in mkwasmbuilds.c.
FossilOrigin-Name: 81840bd4b2132c1c701bb6fd5a2ac48a4ed33d2b68a3f7a826fa32dc0fc16483
2026-01-19 22:20:12 +00:00
stephan
d50161a3cd wasm: remove the bundler-friend builds from the 'all' target, as they're only needed for the 'npm' target.
FossilOrigin-Name: dfe4b788ca6596ea9f26445c864f56f81c7816798f5fedfc4e89ba1eb097b0aa
2026-01-19 22:01:10 +00:00
stephan
4eb307cf46 Minor doc touchups in the opfs-sahpool VFS. No functional changes.
FossilOrigin-Name: 67c0d11701842baaa5227ccce02483ead07bec8426b9861f2e2a0465414ae382
2026-01-19 21:57:32 +00:00
stephan
bc2101b44e wasm: filter the custom Module.instantiateWasm() out of node builds, per request from the npm project.
FossilOrigin-Name: b57a8215f4259a0aae188b7ee5060f8ff48919303179aae80b58b43ed3b991f5
2026-01-12 15:43:18 +00:00
stephan
428c2656ff Add the @preserve tag to the standalone file sqlite3-opfs-async-proxy.js.
FossilOrigin-Name: 334b2be57e752672cfcaf764e3bc73e3d00a0a5174e8ef7c3d83c26136bccaf5
2026-01-11 16:21:32 +00:00
stephan
9ab2a2af1b wasm: add @preserve tags to two comment blocks (license header and build version info) so that the npm tools know to retain those comments when minifying.
FossilOrigin-Name: 596f1ea084e78843aa668d3a197690929848d474e55ff7b1444f78bd11f116b1
2026-01-11 14:14:16 +00:00
stephan
aef151ada7 Add the 'npm' ext/wasm makefile target to create npm-bundle.zip for use by the downstream npm package. This target is intended to become their path for pulling npm-relevant deliverables, rather than the canonical downloads, and they have our/my commitment not to break it without involving them first.
FossilOrigin-Name: a4752c18a85bee0cef61ee5ac7911661c1894fb861412c957692069195a001a5
2026-01-09 19:44:31 +00:00
stephan
0ad6c6c440 Fix the wasm snapshot build's zipfile name to include '-snapshot' and correct the update-docs target for recent build refactoring.
FossilOrigin-Name: 0f53dbf06010f66ba23941ee4269d507efa370f1a8cc0099d274d8baadebdb46
2026-01-09 18:42:27 +00:00
stephan
22c99e01ff Fix the sqlite3-worker1.mjs (ESM, non-bundler) build and have demo-worker1-promiser use that file rather than the vanilla one, as a test case. Delete the global symbol installed by that file in ESM and bundler builds, as it's unnecessary there. The first change should resolve [https://github.com/sqlite/sqlite-wasm/issues/123|downstream sqlite-wasm/issues/123], with thanks to Jure Rotar for his help.
FossilOrigin-Name: 11f5ab0dd8efc68112c3dc5ea0ed486c32bcdb9fde85352180f40a77c6354cac
2026-01-08 18:15:23 +00:00
stephan
784bceae33 Remove an obsolete '32-bit' label from tester1-worker.
FossilOrigin-Name: e14d9a980351a8d5e935e6991ea02a1c40c9ea8f0ad0fadcabe07d575a9b289c
2026-01-08 15:06:28 +00:00
stephan
92730d21ff Fix the --size X flag for speedtest1.html when X=0 and force the job size to 5 for kvvfs so that it doesn't block the main thread for too awful long.
FossilOrigin-Name: e2634e500cce44650ad5dd95b722b993b1f999b9f8b2396ab15154e67cb065c7
2026-01-08 15:03:00 +00:00
stephan
3262f769ee In fiddle, remove the default .dot-commands it runs, as they do not reflect current shell defaults.
FossilOrigin-Name: 27b6aeda5d70e3480b1448b06277a19395b30a205f3f3bac5ce0e4102e3849ed
2025-12-10 16:20:44 +00:00
stephan
567dcbb5db Update the added-in-version stamp to some kvvfs JS APIs.
FossilOrigin-Name: 939275c6c574a3354e0626164aab1a005998f811c53a66b078249d6b2fcbd68e
2025-12-08 13:11:17 +00:00
stephan
91479c6b10 Introducing kvvfs v2 for the JS bindings. Summary: no longer hard-coded to session/localStorage, available outside of the main UI thread (non-persistently), a simpler-to-use import/export API, and adds an asynchronous event interface intended for creating page-by-page db backups.
FossilOrigin-Name: ec866b04d088e53b09764d00f5403902785328fd8f3cbf80d3affa166477711d
2025-12-08 13:06:27 +00:00
stephan
b6306586ec kvvfs: make the filename suffixes -wal and -shm illegal and teach xAccess() to silently not fail for illegal names (else it breaks things when a -wal file is checked for).
FossilOrigin-Name: 2ea29c77a85236ca4126c05c7fd1d45a80dfe3f653af9b3ed86d6e62877ec5af
2025-12-02 18:28:22 +00:00
stephan
b58b45d48e Get kvvfs::xAccess() fleshed out.
FossilOrigin-Name: d947e9bed5affee3f6e54b0fe3e2b1a0ac3771865b93c06a4087318f26d87f7f
2025-12-02 18:10:53 +00:00
stephan
6993f52d94 Consolidate kvvfs's page size workaround into a central flag and add some logging to facilitate testing and debugging.
FossilOrigin-Name: 8d683130d2f2aaf6300a8c858802eb671e831ed520621af59c9e830e87a9d753
2025-12-02 16:29:28 +00:00
stephan
22b1bc9997 Add more logging to kvvfs to try to trace down why it cannot recover from a page size change.
FossilOrigin-Name: 0bf0b8a98a2cc5128aa0e510ef2fe411a6859ce807d6159175f5eaf3bc14183b
2025-12-02 15:47:32 +00:00
stephan
9d6b913098 Begrudingly allow sqlite3_js_kvvfs_clear() to work for opened storage only for the local/session storage cases and only (one of the demo apps reminds me) for backwards compatiblity. Likewise, the JsStorageDb.clearStorage() inherited method is now deprecated because it requires an opened db (but continues to work for those two stores), whereas its 'static' method of the same name is unaffected. Rename kvvfs.size() to kvvfs.estimateSize().
FossilOrigin-Name: 09e9255828ed6a7ccbe18f701f4a88b859cfdbd1ddca7ac5dac09744542c25fa
2025-12-01 22:20:54 +00:00
stephan
f1d5e9e913 Harden a change to SqliteTestUtil.assert() in the previous checkin to handle a null second argument.
FossilOrigin-Name: 9cbd5be803aba28916440cfa70c54588e7891d2073caebfa2b4dfcdd434b5c49
2025-12-01 21:14:11 +00:00
stephan
2463c80b54 Minor JS docs and cleanups. Add some #if'd-out kvvfs and oo1 pieces to experiment with later.
FossilOrigin-Name: 3db29b00db8d75c6b6a909a46a5c71515d3407af27ff9cb79091f293e4005ce3
2025-12-01 21:10:16 +00:00
stephan
4b6e26c29f Fix a potential UAF in sqlite3.oo1.DB.exec()'s teardown pieces.
FossilOrigin-Name: 7e99e93cddeba555836206a278c5dcfd8565cc2a486a83cffab64dad168e9464
2025-12-01 19:19:06 +00:00
stephan
db94b3c0d7 Relax the name limits on kvvfs dbs.
FossilOrigin-Name: 9901cf8e4a00ea9a199a3fb54bd58bd66cff4d02c55433d55f2b417e188e49e0
2025-12-01 16:28:55 +00:00
stephan
c281beded3 Reformulate sqlite3-wasm.c's exports so that they export properly with the wask-sdk compiler.
FossilOrigin-Name: d71849958aabdb05225be18d6bc46699cfda9de67c7105b11c3f79d1d01f47d4
2025-12-01 16:25:53 +00:00
stephan
b8f8d021c9 Teach kvvfs to handle a NULL db file name by generating a random name, and to honor the SQLITE_OPEN_CREATE flag.
FossilOrigin-Name: 104291469169bef0c2ec5aee9c1cc505447541801bc822e6d5fe5360aef6a2e4
2025-12-01 15:49:31 +00:00
stephan
7c74a3fba5 Fix filtering of the 64-bit speedtest1 wasm test pages to again load the 64-bit wasm files.
FossilOrigin-Name: f507a8af41228d4ca332ab27e842767016ca18adda92e27a1e02e78f12c9be79
2025-11-30 18:59:44 +00:00
stephan
8ff58b4f41 kvvfs docs and 64-bit fixes.
FossilOrigin-Name: cf58e17fa2dc2e183a6ea1d41795c701efb303c9b378aa9b90953c9b568c621a
2025-11-30 18:43:59 +00:00
stephan
4694b91988 Optimize out a kvvfs event notification call in the common case where there are no listeners.
FossilOrigin-Name: 8405c19d32f1e8b7273953a038f8bdfd4ea1a6548300bac5421cdf6fc6840285
2025-11-30 16:37:47 +00:00
stephan
316020580e Rename kvvfs's 'localThread' storage object to '.'. Swap kvvfs.listen()'s elideJournal(=false) option with includeJournal(=false) (i.e. opt in instead of opt out).
FossilOrigin-Name: 7f0eca9d0aeb49c86a785ae930d235902bbd0f15877cc8f6083daac8efb2d1c1
2025-11-30 08:32:52 +00:00
stephan
9dd6979f3e Add sync events to kvvfs.listen() so that streaming can maybe get a better sense of when it's okay to process the stream.
FossilOrigin-Name: a4b6dadffa1b43aadebfa06a1de14d763efd18b16c4a3e87f1bd039fbff2524d
2025-11-30 07:08:45 +00:00
stephan
3dbe1f2f96 More work on the kvvfs events. Demonstrate re-importing a streamed-out set of db pages.
FossilOrigin-Name: b8fee839b0199d1d2714c99612ea4b4d943d8b0033d742eaa66e1575ce46f0d2
2025-11-30 06:20:28 +00:00
stephan
b4397ec831 Give kvvfs.unlisten() a useful result value.
FossilOrigin-Name: bbd08b67ceeaae2a3a82655da5a3983f4e9057424de4223f1505ba74c36238af
2025-11-30 05:25:44 +00:00
stephan
9f83f4c563 Extend the kvvfs.listen() config to enable posting of raw binary db pages instead of the kvvfs-encoding. This is much more expensive but was added to... Demonstrate basic async streaming of kvvfs db page-level changes via logging of kvvfs write/delete ops.
FossilOrigin-Name: 0f2bad285577c26f1185dcafd3b8ca2f16e74aa9dc40e6e23867150bccee4602
2025-11-30 05:20:17 +00:00
stephan
768c364aaa Extend kvvfs export to optionally export the raw binary db pages as a list of Uint8Array instead of kvvfs-encoded strings. This is typically much larger but the pages can then be used as-is.
FossilOrigin-Name: a4f59496a53a079f8f73e4cde68f47dbd13d2d74de2ad11bc716e7e5c00f1ec0
2025-11-30 03:02:06 +00:00
stephan
e8416526f0 Fix kvvfs event notification to notify _all_ listeners and optimize better for the common case of no listeners. Squelch some debug output.
FossilOrigin-Name: 989d097b1324cf712107bb81697fa8e9044aea0e7feacf0e6b6561e216f07989
2025-11-29 23:29:30 +00:00
stephan
f2ec1d2560 Add a WASM-side export for kvvfsDecode() for pending private use in the kvvfs export bits and ensure that it consistently returns -1 for malformed input.
FossilOrigin-Name: cd81cb70525edeb25c4ab287cd5fd03db08ec45fd9e4001cad5c3eadf11505ae
2025-11-29 23:29:07 +00:00
stephan
4719c67753 More tests for the kvvfs vtab.
FossilOrigin-Name: 0358a99eedb503aaf8eff32a3143a2591081dfd3fd9eeecc51c601c98c714d6f
2025-11-29 21:19:35 +00:00
stephan
facbf34cbf Add a kvvfs vtab for inspecting the storage state. This is for testing and my own edification, not part of the public API.
FossilOrigin-Name: eaff2e8b7f63575e85fb9be800a2c59163e402d6a25fc6a955b9df15afe13b92
2025-11-29 16:41:27 +00:00
stephan
c4a22d6c14 Merge trunk into the kvvfs-v2 branch.
FossilOrigin-Name: 0e1a6ca0f1123da680918027b16608bf87593a9d91f7b1f3fc0c3a454185740d
2025-11-28 22:17:02 +00:00