Commit Graph

1131 Commits

Author SHA1 Message Date
stephan
6142310e08 When fiddle terminal mode is enabled, add a link to the jquery.terminal project in the About box.
FossilOrigin-Name: d64f0c8845104008d6c251f9a1406c6ff717a916c13b64014aa1d154501d5fab
2026-04-11 20:43:49 +00:00
stephan
57cf5c2dfc fiddle: disable jquery.terminal's pre-processing of user input, as discussed in [forum:c6665017c0dbba1f|forum post c6665017c0dbba1f], with many thanks to the jquery.terminal team for this workaround.
FossilOrigin-Name: ea7e121ab2a7b2fee5372ca12a2a53c7e98ffa1b49d85944f7ce4a7251a777c8
2026-04-11 20:31:03 +00:00
drh
a212476ad2 Improvements to the interactive prompt in the CLI:
(1) CLI honors SQLITE_PS1 and SQLITE_PS2 envvars as prompt strings,
(2) CLI prompt strings expand various backslash escapes,
(3) No arbitrary length limits on CLI prompt strings,
(4) New default prompt shows the database filename using the \f
escape,
(5) SQLite core adds the sqlite3_incomplate() API, used by
the \H escape in prompt string rendering,
(6) Enhancements to the ".prompt" dot-command.

FossilOrigin-Name: 55af98054e073d6eee3e85fd7564c83eca935ae205da68f5e8f1b561e7f08c00
2026-04-11 18:38:54 +00:00
stephan
7a0a0a22e7 Ensure that sqlite3-opfs-async-proxy.js is copied into the fiddle target dirs.
FossilOrigin-Name: 149200861e4690dab5f2e690b62f355b13a8370dccaab5546caa6842b4ff963a
2026-04-10 23:31:29 +00:00
stephan
504cfd5ec7 Ensure that sqlite3-opfs-async-proxy.js is copied into the fiddle target dirs.
FossilOrigin-Name: 7c9998de1b839cfbe12c4328ac5176f5fae981e139c5f8888b100752f5e4756b
2026-04-10 23:25:57 +00:00
stephan
9d950aa13b A protype of .prompt support in fiddle but its utility there is in doubt because .open does not work there, so there's very little dynamic info worth showing in a prompt. Also, ANSI colorization can't work there, nor can we colorize the prompts using HTML because of limitations in jquery.terminal.
FossilOrigin-Name: 3b17500dc6338df23d1ed0572cd71593da5a9b048731f73242e27b9a76553a27
2026-04-10 23:05:41 +00:00
stephan
b709ba8108 Expose the main /fiddle object to the browser dev console as globalThis.fiddle for experimenting with a dynamic prompt.
FossilOrigin-Name: 8574e5c9da3b167384faafb8ec0d01953578676cc42536bb6f7d0e73408ced36
2026-04-10 21:58:13 +00:00
stephan
35f8abcfd0 API doc correction for sqlite3_js_retry_busy(). No code changes.
FossilOrigin-Name: 749c537812b907164b7e7ad1fddc1aee8106c59875d2686fe83d602cd0e07611
2026-04-10 17:55:31 +00:00
stephan
d4b74b9fac Add some comments to the OPFS async proxy about potential future experimentation. No code changes.
FossilOrigin-Name: 9c14ee74305a5db3be95dbd9ae8d1db0abf39b323001be4e2f02b7226e6ca0d3
2026-04-04 08:07:25 +00:00
stephan
eb8edc0bac Doc cleanups in opfs-wl. No code changes.
FossilOrigin-Name: 009b576dcd5fccaaa52459dbfaa1b2a6fcf6d372e4b8d63553dfa88aab9a759c
2026-04-01 11:39:13 +00:00
stephan
a217a4af09 Require a button click to start the OPFS concurrency tester, rather than simply launching all N workers immediately on page load.
FossilOrigin-Name: 3342d6786e07d3d8dd4b1f2291edea9f8354d384ff21242cc513c218ce6f1630
2026-03-23 13:17:13 +00:00
stephan
5236bad923 Consolidate the opfs and opfs-wl tester1 tests using the preprocessor.
FossilOrigin-Name: 77846c8c7aa4625729a5e113c12e7d16efc88c1306c01ba36f47240aac450b0f
2026-03-08 17:07:01 +00:00
stephan
46a692c08b Upgrade ext/wasm/c-pp-lite.c to its newer sibling because we've reached the older one's limits. This renames c-pp-lite.c to libcmpp.c to maintain both the SCM- and code lineage but that may end up looking a bit weird because the diff between the two is vast.
FossilOrigin-Name: 2e2339bd9e4293bad04ece7673a3048b99c2143cf9573ade2ec082d95744b981
2026-03-08 16:03:08 +00:00
stephan
02cbc96d09 JS doc updates.
FossilOrigin-Name: 699295f84ef2c4da363f13126abde6af07697d0959896cd868b14513d4278964
2026-03-08 12:42:34 +00:00
stephan
976b50620a Merge opfs-wl into trunk, not so much for the "opfs-wl" VFS, which is stil tentative (working fine but with little perceived benefit), but for the "opfs" VFS cleanups which necessarily happened around it.
FossilOrigin-Name: bcaa876c6dafee0995d239f59b6ce7810b6f5faa219b9c392966211ae3dec17a
2026-03-08 08:32:22 +00:00
stephan
303fad1f91 Update the tester1 SEE tests to account for opfs-wl.
FossilOrigin-Name: 616d32c8380ef47c5a7c2eb765e7b6fbec9500d4e16c837f4ee11d71c239a55f
2026-03-08 08:09:09 +00:00
stephan
03b0f8fc9c Refactor tester1 OPFS test to support both the "opfs" and "opfs-wl" VFSes.
FossilOrigin-Name: 17ac8d7bdfaf96510abea8c11019045c1703b7040655d9c4c8d7001636260b50
2026-03-08 07:58:02 +00:00
stephan
9358070cb3 Expose sqlite3_bind_zeroblob() to JS/WASM.
FossilOrigin-Name: 0c5d4fe0bd322b4c8dbd0800001317a21cd511b00244de74b4db3fd051153879
2026-03-08 05:53:47 +00:00
stephan
237fce8205 Extend the JS pre-bootstrapping configuration to include an option to disable inclusion of any given extension VFS (not the default VFSes, like memdb). The primary motivation for this is to give people who don't use OPFS to a way to keep the OPFS VFSes from loading their proxy workers, which are expensive.
FossilOrigin-Name: 9a07eb7a941479510891d1444aacbeb440efaad3e9a13f186833618d8b60a8da
2026-03-07 06:10:29 +00:00
stephan
78649bb421 Fix the mangling of the opfs async proxy script's URI caused by both OPFS VFSes modifying it to accound for sqlite3.dir. Add a link to speedtest1 with opfw-wl to index.html.
FossilOrigin-Name: c1cb61f473a11a325ef421ba8edfb20257203688565f7db62309044be183af5f
2026-03-07 04:19:08 +00:00
stephan
7d10030d75 Cleanups and docs in the opfs vfs and its concurrency tester. Experimentally add sqlite3.capi.sqlite3_js_retry_busy(), which runs a callback repeatedly until it _stops_ returning (or throwing) an SQLITE_BUSY error.
FossilOrigin-Name: 45c02ed21635f7ef45214ab5ec6230b6b8bd89e35ef5889db318523e1c679fea
2026-03-07 03:32:17 +00:00
stephan
f20c4e650d Elide more of the 64-bit was stuff from the default build target.
FossilOrigin-Name: 3b74ad9081daee560bf9b400e69a75abcc62dae7c5f55dcf46de84daae50ed9f
2026-03-07 03:29:26 +00:00
stephan
9be458e611 Cleanups and docs in the new opfs code structure.
FossilOrigin-Name: 3b470c4c7a1fcc710e6b9eae32134c7f6c3f6008b24c7351257f66f5e8f70311
2026-03-07 02:19:23 +00:00
stephan
57d0fe254a For backwards compatibility, ensure that the "opfs" VFS does not specifically require Atomics.waitAsync() (a new requirement of "opfs-wl"), but make use of it if available. Only apply jitter to the concurrency test runs at random intervals.
FossilOrigin-Name: f2175f526c00cfe562e8f332eb197b5ef2c3d6be1fff2aab1566c2c533a293ac
2026-03-07 01:01:13 +00:00
stephan
ac63b524ac Add some jitter and duration info to the opfs concurrency tester. Ensure that Atomics.waitAsync() is available for opfs-wl. Further testing has shown that Web opfs-wl is consistently fairer about doling out contested locks but it's dog slow compared to the original VFS under moderate concurrency. In single-connection use they're effectively on par.
FossilOrigin-Name: a9aecc987512d60f2663973f43c769cf086fc14149edfbcb18c0aec9f5aa3dbf
2026-03-06 23:50:44 +00:00
stephan
2251f0c4cc Get "opfs" and "opfs-wl" properly split. Speedtest1 and the concurrency tester are happy with opfs-wl but it is not yet plugged in to tester1.
FossilOrigin-Name: 12dcd5425967b6306f3e3178babeac130962edb78e6298d545a429a1a20457cc
2026-03-06 22:21:06 +00:00
stephan
a85d09f1a4 Minor cleanups and docs. Teach the OPFS concurrency tester to deal with SQLITE_BUSY instead of failing.
FossilOrigin-Name: 247ffed141f66a6a5a396a3e002995a9f00c70333271199200530066e77956c4
2026-03-06 19:33:25 +00:00
stephan
a98f278f58 This one reliably runs 5 workers. Checking in before subsequent cleanups and debug output removal break it.
FossilOrigin-Name: ba81d95febc5fd0f9bbb2685fef5b1b10f9991751f2bdfafba80c15877af1cef
2026-03-06 17:10:28 +00:00
stephan
c008b8fe3e Correct an internal doc falsehood.
FossilOrigin-Name: 53aa080e357d7a2ffeab68a3584fda43d51ecef3dc8a1d46dd32392ae4f9740c
2026-03-06 16:15:32 +00:00
stephan
7b9cd03c0a This Web Lock impl can reliably run a single OPFS connection but rather unreliably 'loses' workers with higher counts, presumably due to deadlock or deadly embrace (how _all_ of them can deadlock at once is unclear, but clearly a bug).
FossilOrigin-Name: d4e8583e2e80665adfe4e814adb6c219936af1dcac4105795045cb1a7b1e4864
2026-03-06 16:04:21 +00:00
stephan
ad2fe531d0 Expose SQLITE_{DBCONFIG_FP_DIGITS,LIMIT_PARSER_DEPTH,PREPARE_FROM_DDL} to WASM and add support for DBCONFIG_FP_DIGITS to the variadic wrapper for sqlite3_db_config(). These unfortunately went overlooked before the 3.52 release.
FossilOrigin-Name: 837069635e53849cbca0aa876bad7c7ff44e17578ae492e07acf354067b7e16d
2026-03-06 15:41:17 +00:00
stephan
544ef18bbd Remove an extraneous OPFS metrics increment.
FossilOrigin-Name: bf3548a37712e848c7a9cadfdc1669a2be572ea0a0c28d84c157ab30f8c30c44
2026-03-06 11:49:36 +00:00
stephan
891f5a176b A slight simplification/optimization in the OPFS proxy's waitLoop().
FossilOrigin-Name: 521bb140b7ed237c118ac9094732d06907229a6ff385502e850c679bd623fd58
2026-03-06 09:11:47 +00:00
stephan
831e233202 Reimplement the OPFS async proxy's wait-forever loop to be more async-friendly for upcoming changes.
FossilOrigin-Name: fd775772fbb50b04c8c37977b90a708784eefed403e3668196c9d95559d3a5e1
2026-03-06 09:06:24 +00:00
stephan
14b5eadefe Strip the opfs-wl "back to formula", removing the current false starts so that this can be tried again without tripping over any cruft. The current impl is subject, with no obvious way out of it, to starvation in the async proxy.
FossilOrigin-Name: d022f1f5e74dedae044801330eb099022498f359f408e69b3574885641b312f5
2026-03-05 11:51:27 +00:00
stephan
cef3ff74cd The opfs-wl lock hang has been traced to starvation between the WebLock and the tight wait-on-VFS-calls Atomics.wait() loop. This can reportedly be resolved with another level of indirection in which the WebLock takes over the wait-on-VFS-calls part until it's unlocked, returning to the global loop when it's done. That exceeds this morning's ambitions but is next to try out.
FossilOrigin-Name: 113bd910e12fea17f9f4a0a3baf706f15627c08cfa6b47a960a83eee761ef4dd
2026-03-05 06:30:57 +00:00
stephan
671a6f83f4 Add some debugging output to opfs and track down the breakage to the initial WebLock request, which is never reaching its callback. Still broken, but this is progress.
FossilOrigin-Name: 62fc8b35aeec75f5648b3daa24162c638999d447aa874bdfcbac1431c5c97b6f
2026-03-04 21:16:36 +00:00
stephan
232446b532 Get opfs-wl plugged in to the concurrency tester. Somewhat ironically, all competing workers fail with locking errors while worker 1 is busy running off the rails somewhere. Stashing for closer investigation later.
FossilOrigin-Name: 3b27310aa29ea84f459974981a600301abac5c705029a289d3872ecacf231da3
2026-03-04 20:33:21 +00:00
stephan
b85067c568 Consolidate the last 200 lines of common OPFS VFS code. "opfs" still works, "opfs-wl" registers fine but is still otherwise untested.
FossilOrigin-Name: 5978ee4902e4223fed6b95bd2d8f489bb300af8b762650e7113d1f3e97519d88
2026-03-04 19:21:09 +00:00
stephan
080da5f56d Factor out about 300 lines of common OPFS VFS bootstrapping code.
FossilOrigin-Name: 57adecbab71795b62b1c2e4570ff504f35681e81dd8c94f78ad8e05ef39d36fd
2026-03-04 17:54:02 +00:00
stephan
691494a93b Consolidate the OPFS VFS's metrics-tracking code.
FossilOrigin-Name: b71c79ef9672c77a72a976ffcd7cbebfaf0ff314dff97b274f7d092de6a7773f
2026-03-04 16:30:51 +00:00
stephan
6ff9fcfad2 Baby steps in consolidating common OPFS VFS code.
FossilOrigin-Name: b0dd23299e97ff975f213cb3a8b051f4d7b785b29def82e01f53427fdf77ecb6
2026-03-04 14:33:33 +00:00
stephan
96daad10fa Consolidate much of the OPFS utility code into a new file for use by two of the OPFS VFSes.
FossilOrigin-Name: db19a6e9663c3a44996178cb8c35dc4ccd60f48cb4b81b6c214411a56c57def7
2026-03-04 11:37:39 +00:00
stephan
6d6bf30735 A potential fix for the probable breakage of bundler-friendly builds in the previous check-in. Pending review from someone who uses those tools.
FossilOrigin-Name: 8ea85776116521526d684f221d67e288126e62931d4a0ea7fc7f164cd2d5b2ec
2026-03-04 00:48:03 +00:00
stephan
9ac95d9ce1 opfs-wl is now loading and registering but it's still untested.
FossilOrigin-Name: 9a471f7491a371052bf1785098ba966dd0d03503e7d8b9fbcd65f07b038e5021
2026-03-04 00:37:55 +00:00
stephan
a2d3a54f80 An initial attempt to plugging opfs-wl into the build but its initial handshake with the async half collides with the opfs VFS's handshake, causing bootstrapping to fail miserably. We'll need to either devise a handshake which can differentiate between the two instances or we'll need to preprocess sqlite3-opfs-async-proxy into two copies. Move the (now) three copies of some common code shared by the opfs pieces into a preprocessor #include.
FossilOrigin-Name: 1e0b72631aecb0bb72f4089116da221e6c4abf962db589de08132cd52c2be0e2
2026-03-03 23:43:40 +00:00
stephan
0b7b802d83 Add a missing reset of the lock handshake SharedArrayBuffer slot.
FossilOrigin-Name: 5910ed7ac843aa1fdb103ddcfaf6270d12cb39199205fc0b9f721fbf7fa2f851
2026-03-03 21:46:44 +00:00
stephan
e2309eebd7 Implementations of WebLock-based opfs::xLock() and xUnlock(). Still completely untested and not yet integrated into the build.
FossilOrigin-Name: 3343e3aabe465f4ab91dd148dfc5a60346e9afb560c10d1f92aeae98763ec3ce
2026-03-03 21:07:46 +00:00
stephan
d016fad5a8 Merge trunk into the opfs-wl branch.
FossilOrigin-Name: 81bc4b3b6abc19f98d1f3b1065c4b39a42620a0d7abebe98605dca62dd2d6f9a
2026-03-03 18:34:59 +00:00
stephan
5c4692b6a9 Add JS tests for sqlite3_bind_zeroblob().
FossilOrigin-Name: 0473eeb3cefa1d7882375e3f89d239d570649349c5a0a8ddd90b0a336a9bb493
2026-03-03 14:13:34 +00:00