]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
10 days agoReplace some double-quotes with single quotes an SQL doc snippet in the csv example... kvvfs-v2
stephan [Mon, 8 Dec 2025 12:24:23 +0000 (12:24 +0000)] 
Replace some double-quotes with single quotes an SQL doc snippet in the csv example virtual table.

FossilOrigin-Name: 1781e5e8d0cd2b508f7992987257416bd48841ea7e30bc9294784a7c1a402be7

2 weeks agokvvfs: make the filename suffixes -wal and -shm illegal and teach xAccess() to silent...
stephan [Tue, 2 Dec 2025 18:28:22 +0000 (18:28 +0000)] 
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

2 weeks agoGet kvvfs::xAccess() fleshed out.
stephan [Tue, 2 Dec 2025 18:10:53 +0000 (18:10 +0000)] 
Get kvvfs::xAccess() fleshed out.

FossilOrigin-Name: d947e9bed5affee3f6e54b0fe3e2b1a0ac3771865b93c06a4087318f26d87f7f

2 weeks agoConsolidate kvvfs's page size workaround into a central flag and add some logging...
stephan [Tue, 2 Dec 2025 16:29:28 +0000 (16:29 +0000)] 
Consolidate kvvfs's page size workaround into a central flag and add some logging to facilitate testing and debugging.

FossilOrigin-Name: 8d683130d2f2aaf6300a8c858802eb671e831ed520621af59c9e830e87a9d753

2 weeks agoAdd more logging to kvvfs to try to trace down why it cannot recover from a page...
stephan [Tue, 2 Dec 2025 15:47:32 +0000 (15:47 +0000)] 
Add more logging to kvvfs to try to trace down why it cannot recover from a page size change.

FossilOrigin-Name: 0bf0b8a98a2cc5128aa0e510ef2fe411a6859ce807d6159175f5eaf3bc14183b

2 weeks agoBegrudingly allow sqlite3_js_kvvfs_clear() to work for opened storage only for the...
stephan [Mon, 1 Dec 2025 22:20:54 +0000 (22:20 +0000)] 
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

2 weeks agoHarden a change to SqliteTestUtil.assert() in the previous checkin to handle a null...
stephan [Mon, 1 Dec 2025 21:14:11 +0000 (21:14 +0000)] 
Harden a change to SqliteTestUtil.assert() in the previous checkin to handle a null second argument.

FossilOrigin-Name: 9cbd5be803aba28916440cfa70c54588e7891d2073caebfa2b4dfcdd434b5c49

2 weeks agoMinor JS docs and cleanups. Add some #if'd-out kvvfs and oo1 pieces to experiment...
stephan [Mon, 1 Dec 2025 21:10:16 +0000 (21:10 +0000)] 
Minor JS docs and cleanups. Add some #if'd-out kvvfs and oo1 pieces to experiment with later.

FossilOrigin-Name: 3db29b00db8d75c6b6a909a46a5c71515d3407af27ff9cb79091f293e4005ce3

2 weeks agoRelax the name limits on kvvfs dbs.
stephan [Mon, 1 Dec 2025 16:28:55 +0000 (16:28 +0000)] 
Relax the name limits on kvvfs dbs.

FossilOrigin-Name: 9901cf8e4a00ea9a199a3fb54bd58bd66cff4d02c55433d55f2b417e188e49e0

2 weeks agoReformulate sqlite3-wasm.c's exports so that they export properly with the wask-sdk...
stephan [Mon, 1 Dec 2025 16:25:53 +0000 (16:25 +0000)] 
Reformulate sqlite3-wasm.c's exports so that they export properly with the wask-sdk compiler.

FossilOrigin-Name: d71849958aabdb05225be18d6bc46699cfda9de67c7105b11c3f79d1d01f47d4

2 weeks agoTeach kvvfs to handle a NULL db file name by generating a random name, and to honor...
stephan [Mon, 1 Dec 2025 15:49:31 +0000 (15:49 +0000)] 
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

2 weeks agoFix filtering of the 64-bit speedtest1 wasm test pages to again load the 64-bit wasm...
stephan [Sun, 30 Nov 2025 18:59:44 +0000 (18:59 +0000)] 
Fix filtering of the 64-bit speedtest1 wasm test pages to again load the 64-bit wasm files.

FossilOrigin-Name: f507a8af41228d4ca332ab27e842767016ca18adda92e27a1e02e78f12c9be79

2 weeks agokvvfs docs and 64-bit fixes.
stephan [Sun, 30 Nov 2025 18:43:59 +0000 (18:43 +0000)] 
kvvfs docs and 64-bit fixes.

FossilOrigin-Name: cf58e17fa2dc2e183a6ea1d41795c701efb303c9b378aa9b90953c9b568c621a

2 weeks agoOptimize out a kvvfs event notification call in the common case where there are no...
stephan [Sun, 30 Nov 2025 16:37:47 +0000 (16:37 +0000)] 
Optimize out a kvvfs event notification call in the common case where there are no listeners.

FossilOrigin-Name: 8405c19d32f1e8b7273953a038f8bdfd4ea1a6548300bac5421cdf6fc6840285

2 weeks agoRename kvvfs's 'localThread' storage object to '.'. Swap kvvfs.listen()'s elideJourna...
stephan [Sun, 30 Nov 2025 08:32:52 +0000 (08:32 +0000)] 
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

2 weeks agoAdd sync events to kvvfs.listen() so that streaming can maybe get a better sense...
stephan [Sun, 30 Nov 2025 07:08:45 +0000 (07:08 +0000)] 
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

2 weeks agoMore work on the kvvfs events. Demonstrate re-importing a streamed-out set of db...
stephan [Sun, 30 Nov 2025 06:20:28 +0000 (06:20 +0000)] 
More work on the kvvfs events. Demonstrate re-importing a streamed-out set of db pages.

FossilOrigin-Name: b8fee839b0199d1d2714c99612ea4b4d943d8b0033d742eaa66e1575ce46f0d2

2 weeks agoGive kvvfs.unlisten() a useful result value.
stephan [Sun, 30 Nov 2025 05:25:44 +0000 (05:25 +0000)] 
Give kvvfs.unlisten() a useful result value.

FossilOrigin-Name: bbd08b67ceeaae2a3a82655da5a3983f4e9057424de4223f1505ba74c36238af

2 weeks agoExtend the kvvfs.listen() config to enable posting of raw binary db pages instead...
stephan [Sun, 30 Nov 2025 05:20:17 +0000 (05:20 +0000)] 
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

2 weeks agoExtend kvvfs export to optionally export the raw binary db pages as a list of Uint8Ar...
stephan [Sun, 30 Nov 2025 03:02:06 +0000 (03:02 +0000)] 
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

2 weeks agoAdd a comment explaining the new kvvfsDecode() return -1 from [cd81cb70525e].
stephan [Sat, 29 Nov 2025 23:41:34 +0000 (23:41 +0000)] 
Add a comment explaining the new kvvfsDecode() return -1 from [cd81cb70525e].

FossilOrigin-Name: ed9ab366d1c1880d3c06edce6c0c33ad30c7ae59725c1ec1fe3f620be1835630

2 weeks agoFix kvvfs event notification to notify _all_ listeners and optimize better for the...
stephan [Sat, 29 Nov 2025 23:29:30 +0000 (23:29 +0000)] 
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

2 weeks agoAdd a WASM-side export for kvvfsDecode() for pending private use in the kvvfs export...
stephan [Sat, 29 Nov 2025 23:29:07 +0000 (23:29 +0000)] 
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

2 weeks agoMore tests for the kvvfs vtab.
stephan [Sat, 29 Nov 2025 21:19:35 +0000 (21:19 +0000)] 
More tests for the kvvfs vtab.

FossilOrigin-Name: 0358a99eedb503aaf8eff32a3143a2591081dfd3fd9eeecc51c601c98c714d6f

2 weeks agoAdd a kvvfs vtab for inspecting the storage state. This is for testing and my own...
stephan [Sat, 29 Nov 2025 16:41:27 +0000 (16:41 +0000)] 
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

2 weeks agoMerge trunk into the kvvfs-v2 branch.
stephan [Fri, 28 Nov 2025 22:17:02 +0000 (22:17 +0000)] 
Merge trunk into the kvvfs-v2 branch.

FossilOrigin-Name: 0e1a6ca0f1123da680918027b16608bf87593a9d91f7b1f3fc0c3a454185740d

2 weeks agoCorrect a doc falsehood - jquery.terminal does not require pre-building.
stephan [Fri, 28 Nov 2025 17:56:22 +0000 (17:56 +0000)] 
Correct a doc falsehood - jquery.terminal does not require pre-building.

FossilOrigin-Name: 4384c9a108b58a0b8c38c51678aad871f088358b9bff3922299cc7ddb3d247ce

2 weeks agoFiddle build: if JQTERM is set to the dir name of a built jquery.terminal checkout...
stephan [Fri, 28 Nov 2025 17:50:29 +0000 (17:50 +0000)] 
Fiddle build: if JQTERM is set to the dir name of a built jquery.terminal checkout then copy the pieces fiddle needs to enable that input mode. By default it looks in ~/src/jquery.terminal.

FossilOrigin-Name: 9dd16f8e3b8e181ff138b4061c9dbc116cbc6f85ee867a97cd8af6e9e874c7d1

2 weeks agoMinor doc updates.
stephan [Fri, 28 Nov 2025 16:23:24 +0000 (16:23 +0000)] 
Minor doc updates.

FossilOrigin-Name: 66b0f28958311204270053ef1d5e66c0ad04e3a52f2570c543b6d319d75798fa

2 weeks agoFix a problem in the xFilter() method of the fts5_vocab virtual table causing it...
dan [Fri, 28 Nov 2025 11:52:40 +0000 (11:52 +0000)] 
Fix a problem in the xFilter() method of the fts5_vocab virtual table causing it to omit some result rows in some cases where a virtual cursor is used more than once by SQLite.

FossilOrigin-Name: 6c99e81e6c49c078f1b00952774a7007c60dc1b4ba8a8fc11357efe9c9233212

2 weeks agoRename c-pp::ARGV to c-pp::argv and remove its use from the license header (where...
stephan [Fri, 28 Nov 2025 02:34:08 +0000 (02:34 +0000)] 
Rename c-pp::ARGV to c-pp::argv and remove its use from the license header (where it doesn't get applied).

FossilOrigin-Name: a2e18d299c8fd7360de246fdc3a2f92025bf321e06c5baf6032ba98854733e60

3 weeks agoEnsure that the CLI always jumps to the code that frees memory allocations
drh [Thu, 27 Nov 2025 12:15:22 +0000 (12:15 +0000)] 
Ensure that the CLI always jumps to the code that frees memory allocations
prior to exiting when it encounters errors on the command line - just so
that fuzzers won't call that memory leak, even though it is not.

FossilOrigin-Name: 50eaf4266f184963e85ad6235fb3410bf4992db8b3dc7c92be23a2f143c12a6b

3 weeks agoFix an utterly harmless memory leak that occurs when the CLI exits due
drh [Thu, 27 Nov 2025 11:40:40 +0000 (11:40 +0000)] 
Fix an utterly harmless memory leak that occurs when the CLI exits due
to an error in the command-line arguments.

FossilOrigin-Name: 55942e6d582d421187f2806dc93ea931b64dbb4025203540af654f56d1c9bc36

3 weeks agoEnsure that the split-column transformer in QRF correctly
drh [Thu, 27 Nov 2025 11:29:14 +0000 (11:29 +0000)] 
Ensure that the split-column transformer in QRF correctly
transforms the abNum[] array.

FossilOrigin-Name: ea67d8b001d1be3b0410ca697ff7ddda71c957c8ecb6d76e75133ba39b754623

3 weeks agoFix a CLI test case due to a change in error message text.
drh [Thu, 27 Nov 2025 10:57:06 +0000 (10:57 +0000)] 
Fix a CLI test case due to a change in error message text.

FossilOrigin-Name: cf45d534d63878b00d949234e81cf9c67db7d7067bbac2fd5cd1780463fcce06

3 weeks agoFix two harmless compiler warnings in FTS3.
drh [Thu, 27 Nov 2025 01:32:07 +0000 (01:32 +0000)] 
Fix two harmless compiler warnings in FTS3.

FossilOrigin-Name: fd9158e6359a85c509e29ddbb333e5ee5d20aae5dc38cd14425286e5f3764b06

3 weeks agoImprovements to the QRF README.md file to help clarify how to use it.
drh [Wed, 26 Nov 2025 22:58:26 +0000 (22:58 +0000)] 
Improvements to the QRF README.md file to help clarify how to use it.

FossilOrigin-Name: ff589e9e0da99e2248bc7a8bff37e1deb7cbdf8285c18467acd89b65c67401d3

3 weeks agoDo not omit the beginning and ending margins when setting bBorder to QRF_Off,
drh [Wed, 26 Nov 2025 21:56:55 +0000 (21:56 +0000)] 
Do not omit the beginning and ending margins when setting bBorder to QRF_Off,
except when the margins need to be squeezed to fit.  Those extra margins give
a more pleasing appearance, and also make the output the same as psql.

FossilOrigin-Name: 2892aaeed9f55ad87791491068493c2e530eeff4194d156f16745d185760797c

3 weeks agoMinor kvvfs error handling cleanup.
stephan [Wed, 26 Nov 2025 20:20:40 +0000 (20:20 +0000)] 
Minor kvvfs error handling cleanup.

FossilOrigin-Name: 5ec20ebe057af297f5e0ccc0d7184ab0ed720f91db0f470a7cf827df0f2aa530

3 weeks agoTeach kvvf's xClose() and xFileControl() to return more specific result codes for...
stephan [Wed, 26 Nov 2025 20:18:11 +0000 (20:18 +0000)] 
Teach kvvf's xClose() and xFileControl() to return more specific result codes for exceptions.

FossilOrigin-Name: 6b48375972e6e4112efd51ffea0e54d33a4245bf0155b7fa3ca1e3f147eb043c

3 weeks agokvvfs: silently reject attempts to change the page size, as changing it corrupts...
stephan [Wed, 26 Nov 2025 20:12:29 +0000 (20:12 +0000)] 
kvvfs: silently reject attempts to change the page size, as changing it corrupts this vfs for reasons not yet understood. Add more kvvfs tests.

FossilOrigin-Name: 65272adfab333565719bde4f6c5bbe4f0b5415c17a8de43e6b2d7b0518cca4c7

3 weeks agoIn QRF, if the horizontal alignment is QRF_ALIGN_Auto, then use right
drh [Wed, 26 Nov 2025 17:23:11 +0000 (17:23 +0000)] 
In QRF, if the horizontal alignment is QRF_ALIGN_Auto, then use right
alignment for numeric values and left alignment for everything else.

FossilOrigin-Name: 5fdedc69b1ac05bcdc40ee30c1473be75d3afe89e031d750c8fc3dcfa9846d5b

3 weeks agoFactor out an obsolete malloc failure check and an snprintf() for keys in transient...
stephan [Wed, 26 Nov 2025 17:19:44 +0000 (17:19 +0000)] 
Factor out an obsolete malloc failure check and an snprintf() for keys in transient kvvfs storage.

FossilOrigin-Name: e2e94f9094f8bbe93cdf7d2a2e72e92462b94e18319603c5a364f183cb780be1

3 weeks agoRemove a JS-specific block from os_kv.c.
stephan [Wed, 26 Nov 2025 17:17:22 +0000 (17:17 +0000)] 
Remove a JS-specific block from os_kv.c.

FossilOrigin-Name: 3c1d5eac270e8afe6196ccb11a6d7bb0d1f262c882ce390a16b998bd2f55cb3d

3 weeks agoFix tests broken by the previous commit.
stephan [Wed, 26 Nov 2025 16:40:23 +0000 (16:40 +0000)] 
Fix tests broken by the previous commit.

FossilOrigin-Name: 430d4d668fc2d151f20a02ddbbac7f884258af7fd1268d3aafb5f9e8eadf844b

3 weeks agoRemove some dead code. Resolve the remaining kvvfs v1/v2 API compatibility confusion...
stephan [Wed, 26 Nov 2025 16:27:11 +0000 (16:27 +0000)] 
Remove some dead code. Resolve the remaining kvvfs v1/v2 API compatibility confusion by eliding the v1 API from Workers like we've always done. Add some tests.

FossilOrigin-Name: 450b4bcca6038be58a73ff15ff18b9d70df661fe0bd9777273e0db6fbce5f296

3 weeks agoWasm speedtest1: replace some 'self' with 'globalThis' and expose the sqlite3 object...
stephan [Wed, 26 Nov 2025 16:26:27 +0000 (16:26 +0000)] 
Wasm speedtest1: replace some 'self' with 'globalThis' and expose the sqlite3 object to the global scope for inspection via the dev console (for inspecting resulting kvvfs storage objects).

FossilOrigin-Name: c18154bc9a7cf07d3902d74d27b4ca696929aae9e1abe031679bd5a42d759046

3 weeks agoAdd the bBorder option to the QRF spec. Reflect this in the -border
drh [Wed, 26 Nov 2025 16:21:56 +0000 (16:21 +0000)] 
Add the bBorder option to the QRF spec.  Reflect this in the -border
option on the TCL format method, and the --border option to ".mode"
in the CLI.  Also add the "psql" mode to the CLI.

FossilOrigin-Name: 02cbeb69884cd884d9b1b5f59c4168a3dc24b1a5aecc6967586c0be350b10574

3 weeks agoMinor optimization in kvvfs event notification.
stephan [Wed, 26 Nov 2025 14:22:51 +0000 (14:22 +0000)] 
Minor optimization in kvvfs event notification.

FossilOrigin-Name: fd85b96b12d164f7700624dba478d35e886b23f5c31c853715f783639ea95f23

3 weeks agoFix a buffer overread in fts5 that might occur while processing a corrupt db.
dan [Wed, 26 Nov 2025 13:58:53 +0000 (13:58 +0000)] 
Fix a buffer overread in fts5 that might occur while processing a corrupt db.

FossilOrigin-Name: 8b0cbc18be3c6f2501b102757af6be98c48044a296104cca7bce822ac2304515

3 weeks agoInternal kvvfs docs and cleanups. Wasm speedtest1: remove the hard-coded --size=2...
stephan [Wed, 26 Nov 2025 13:55:20 +0000 (13:55 +0000)] 
Internal kvvfs docs and cleanups. Wasm speedtest1: remove the hard-coded --size=2 limit for kvvfs and use a transient storage object instead of session storage (which is limited to --size=2). For small job sizes kvvfs is roughly 3x the speed of memdb and that gap grows as the --size increases, with kvvfs _really_ bogging down on the --size=50 jsonb tests.

FossilOrigin-Name: 43173267849f7f4b77a9ee15ab586e9deb0e290071149857fe18421fb948a715

3 weeks agoConsistently use IsSpace()/IsDigit() instead of isspace()/isdigit() in shell.c.in...
stephan [Wed, 26 Nov 2025 13:24:10 +0000 (13:24 +0000)] 
Consistently use IsSpace()/IsDigit() instead of isspace()/isdigit() in shell.c.in to squelch warnings on Cygwin. From Jan Nijtmans.

FossilOrigin-Name: aa9d7365bb8d8a9d44388dc89dea09428d7cea2f9fba482cb56980b51b16b143

3 weeks agoFix the sha1() extension function so that it returns actual TEXT instead
drh [Wed, 26 Nov 2025 11:19:11 +0000 (11:19 +0000)] 
Fix the sha1() extension function so that it returns actual TEXT instead
of a BLOB containing the UTF-8 TEXT.
[forum:/forumpost/d15eefea7c|Forum post d15eefea7c]

FossilOrigin-Name: 6f806656a3f5ce9a79b18be057d880faca506f66cd4de4b5d77393c266cfb6d2

3 weeks agoTweak testrunner.tcl to allow it to use more cores.
drh [Wed, 26 Nov 2025 00:41:20 +0000 (00:41 +0000)] 
Tweak testrunner.tcl to allow it to use more cores.

FossilOrigin-Name: 71b916d4de7a4611f6ada597bfd58b59cab18e3a732de17c92b7346ecff31c04

3 weeks agoWhen "testrunner.tcl status -d N" is run but the test database is not yet
drh [Tue, 25 Nov 2025 23:59:31 +0000 (23:59 +0000)] 
When "testrunner.tcl status -d N" is run but the test database is not yet
available, it enters a wait loop until the testing begins.

FossilOrigin-Name: 7abc25ff3b24b11c171e715ae96c8e97651d340b7a8bb8125a73902e1ad881ab

3 weeks agoFix typo in the MAKE.BAT
drh [Tue, 25 Nov 2025 22:50:39 +0000 (22:50 +0000)] 
Fix typo in the MAKE.BAT

FossilOrigin-Name: bf54e5fccdf7cd274f3e91a7fd4a23c85f42c0e3163d84ecdb5b9097bdc940d8

3 weeks agoAdd two new makefile targets, "errors" and "status", for checking on testrunner
drh [Tue, 25 Nov 2025 22:38:07 +0000 (22:38 +0000)] 
Add two new makefile targets, "errors" and "status", for checking on testrunner
errors and for running testrunner status -d 2, respectively.  Add a simple
make.bat script at the top level that runs nmake for us, and thus make the
command-line to test on Windows identical to Unix.

FossilOrigin-Name: 838b7fd5d46ed65f22d1da6256fcf979385e37edc8aec4f19064c2c3dc13f2de

3 weeks agoCherry-pick JS fixes/cleanups/docs from [206275292217], [256c1dd2c367], and [dec0c607...
stephan [Tue, 25 Nov 2025 19:29:23 +0000 (19:29 +0000)] 
Cherry-pick JS fixes/cleanups/docs from [206275292217], [256c1dd2c367], and [dec0c6073cc1] from the kvvfs-v2 branch into trunk.

FossilOrigin-Name: cdd3e700f59e5c30241cd5c6d9ea31f6a5f1c7130c6341b4e0b6dc32b06f3c79

3 weeks agoGuard access to a piece of Emscripten-related scaffolding so that sqlite3-api.js...
stephan [Tue, 25 Nov 2025 19:20:15 +0000 (19:20 +0000)] 
Guard access to a piece of Emscripten-related scaffolding so that sqlite3-api.js does not hit it when imported into other builds. Reported in [forum:6eacbb9c447a5665|forum post 6eacbb9c447a5665].

FossilOrigin-Name: cb9cf028fcefa8ec51415b5dac886c2443b2ed207fa388dbc3d725dcc85fe092

3 weeks agoRemove some debug output.
stephan [Tue, 25 Nov 2025 19:06:05 +0000 (19:06 +0000)] 
Remove some debug output.

FossilOrigin-Name: 9fc6b811d6b0e268be18b768b6a69381606557a1702064b29f0ff4ca7c505cac

3 weeks agoRemove the ostensible support for empty kvvfs names, as those names apparently never...
stephan [Tue, 25 Nov 2025 19:05:13 +0000 (19:05 +0000)] 
Remove the ostensible support for empty kvvfs names, as those names apparently never reach kvvfs.xOpen (the empty name is special). That actually simplifies things with regards to backwards compatibility.

FossilOrigin-Name: a5c61fa56770a6fffcb4c76db2256c71b2d5f0beee6fc2c4800c40bf7ef995c8

3 weeks agoImprove kvvfs file name validation. Add sqlite3.kvvfs.unlink().
stephan [Tue, 25 Nov 2025 18:52:08 +0000 (18:52 +0000)] 
Improve kvvfs file name validation. Add sqlite3.kvvfs.unlink().

FossilOrigin-Name: 0dfdf4681cf63541de971a20be21b33d0d3b38e8281f302d20aca9492df3da42

3 weeks agoFix subtle inaccuracies in qrfWrapLine(). Omit an unused variable from shell.c.in.
drh [Tue, 25 Nov 2025 18:20:33 +0000 (18:20 +0000)] 
Fix subtle inaccuracies in qrfWrapLine().  Omit an unused variable from shell.c.in.

FossilOrigin-Name: 5804ba4874cc41b11e8bb559d5533283c2895d2b13316830955663575567f911

3 weeks agoAdd the sqlite3.kvvfs namespace for the new kvvfs APIs instead of adding more sqlite3...
stephan [Tue, 25 Nov 2025 16:41:56 +0000 (16:41 +0000)] 
Add the sqlite3.kvvfs namespace for the new kvvfs APIs instead of adding more sqlite3_js_kvvfs_...() methods. Reinstate that clearing kvvfs storage is illegal when db handles are opened, solely for sanity's sake (they can actually recover from that but supporting such use feels ill-advised).

FossilOrigin-Name: 02793c5905e6b99379cd5ad6bfe1eb6cccf839da081fc174dce7b06245e212fb

3 weeks agoAdd an explicit rollback test for kvvfs.
stephan [Tue, 25 Nov 2025 16:07:05 +0000 (16:07 +0000)] 
Add an explicit rollback test for kvvfs.

FossilOrigin-Name: 2bf31ef8027a3e15887d4dcd26fe09463b5f8852c5ce443f7d07c23d29c37311

3 weeks agoA more compact formulation of [ac8af73c16ab821] which uncovered two remaining direct...
stephan [Tue, 25 Nov 2025 15:59:58 +0000 (15:59 +0000)] 
A more compact formulation of [ac8af73c16ab821] which uncovered two remaining direct calls to kvrecordRead(), now replaced with calls through the thunk. Fix a typo which caused the storage object name to not be passed on to event listener.

FossilOrigin-Name: d391f1ce691fca4504c21a7e3e05a029f247da23d432ee34b0dae14be51d909c

3 weeks agoIn wasm builds, #if out the impls for the 3 core kvvfs i/o routines which get overwri...
stephan [Tue, 25 Nov 2025 15:35:53 +0000 (15:35 +0000)] 
In wasm builds, #if out the impls for the 3 core kvvfs i/o routines which get overwritten from JS (and thus aren't used) to reduce dependencies on POSIX APIs.

FossilOrigin-Name: ac8af73c16ab821a7aa7d28a5fde8aeba0bc4d03c0af0dd2cff288c8fdabc49e

3 weeks agoFix a typo in fts3/4 debugging code allowing 'maxpendinXY' to act as a synonym for...
dan [Tue, 25 Nov 2025 15:11:34 +0000 (15:11 +0000)] 
Fix a typo in fts3/4 debugging code allowing 'maxpendinXY' to act as a synonym for 'maxpending=' in special INSERT statements.

FossilOrigin-Name: 5af554337af3052a5fd734c05883700dd42d140d99d41154b60e1a0f559e5023

3 weeks agoWork around an incorrect compiler warning on Mac.
drh [Tue, 25 Nov 2025 13:58:36 +0000 (13:58 +0000)] 
Work around an incorrect compiler warning on Mac.

FossilOrigin-Name: d4c1d3e30b774802a7abd5f61807a690fb5be7617459f3dbd7ec1efceb6125d7

3 weeks agoFixes to .mode in the CLI. "qbox" sets the correct null value.
drh [Tue, 25 Nov 2025 12:16:56 +0000 (12:16 +0000)] 
Fixes to .mode in the CLI.  "qbox" sets the correct null value.
The "--quote on" option sets the null value to NULL.

FossilOrigin-Name: 5454ec46e162247afa178c8532a0fa19eb05897417ac5b3d2a2ed14bfd331a75

3 weeks agoOmit the unused bTextNull flag from the QRF spec object.
drh [Tue, 25 Nov 2025 10:53:39 +0000 (10:53 +0000)] 
Omit the unused bTextNull flag from the QRF spec object.

FossilOrigin-Name: 4bbf176a87b1bedcce0359b70bbf6831a1e458d48c91dcba49f5e00bb38ecaa1

3 weeks agokvvfs internal cleanups. Experimentally add async event listeners to kvvfs to explore...
stephan [Tue, 25 Nov 2025 05:44:03 +0000 (05:44 +0000)] 
kvvfs internal cleanups. Experimentally add async event listeners to kvvfs to explore backing up a kvvfs a page at a time.

FossilOrigin-Name: f355fd484947a645206c9b9c2fd6fe691455dece7fb1aa5b72cb51a86b39474f

3 weeks agoFactor out some now-superfluous JS-side kvvfs code. Factor out a superfluous allocati...
stephan [Tue, 25 Nov 2025 04:07:50 +0000 (04:07 +0000)] 
Factor out some now-superfluous JS-side kvvfs code. Factor out a superfluous allocation. Shorten the public API names of the new methods.

FossilOrigin-Name: be435b668f1aee56fc4965592c207de25283de238fe89002f1a68ba0567aca65

3 weeks agoDisallow a filename of '-journal' for db files in kvvfs, as that name has a special...
stephan [Tue, 25 Nov 2025 03:09:45 +0000 (03:09 +0000)] 
Disallow a filename of '-journal' for db files in kvvfs, as that name has a special meaning there.

FossilOrigin-Name: 357cc42633efb85c3ca9bc3d6d46430e1ecaf2825e6bdd7d7b4e0f6865d0b599

3 weeks agoAdd xGetLastError() to kvvfs but it does not appear to be called for xOpen() failures.
stephan [Tue, 25 Nov 2025 02:08:49 +0000 (02:08 +0000)] 
Add xGetLastError() to kvvfs but it does not appear to be called for xOpen() failures.

FossilOrigin-Name: 7e7944f00792c5e7a9ea013f9c5d1f6bb6313070de20ec4ce262ff0b430f9801

3 weeks agoFix a 32-/64-bit incompatibility in opfs-sahpool.
stephan [Tue, 25 Nov 2025 02:08:11 +0000 (02:08 +0000)] 
Fix a 32-/64-bit incompatibility in opfs-sahpool.

FossilOrigin-Name: 256c1dd2c367dbc3b3df5028f2004bb1126851109efc71a1699f60f493514fcb

3 weeks agoFix typos in the help text for ".mode" of the CLI.
drh [Tue, 25 Nov 2025 00:21:27 +0000 (00:21 +0000)] 
Fix typos in the help text for ".mode" of the CLI.

FossilOrigin-Name: fddb99c5162ba12a6e3c87e96583d57bae217339b4dd6dc44c3538e738fbf625

3 weeks agoDo not allow the kvvfs transient flag to flag a previously-non-transient storage...
stephan [Mon, 24 Nov 2025 20:43:14 +0000 (20:43 +0000)] 
Do not allow the kvvfs transient flag to flag a previously-non-transient storage as transient. i.e. only applies when first opening a db. Rename the transient flag to delete-on-close to avoid confusion with other meanings of transient in that context.

FossilOrigin-Name: 46d6b636307d98d17344d995afd99204e16eb06b6b19021a824dab95267d5377

3 weeks agoAdd the sqlite3_db_filename() to the sqlite3.oo1.DB tracing output. Document an unfor...
stephan [Mon, 24 Nov 2025 20:36:49 +0000 (20:36 +0000)] 
Add the sqlite3_db_filename() to the sqlite3.oo1.DB tracing output. Document an unfortunate design choice which was only recently recognized as such.

FossilOrigin-Name: dec0c6073cc130ba445ec68bc49a410001d778c4aa21624dcb0a68b88fce251f

3 weeks agoAdd kvvfs URI flag transient=1 to cause the storage object to be removed when the...
stephan [Mon, 24 Nov 2025 20:14:23 +0000 (20:14 +0000)] 
Add kvvfs URI flag transient=1 to cause the storage object to be removed when the last handle to the db is closed. By default it behaves like a filesystem would, retaining the storage objects.

FossilOrigin-Name: c6183261be77d03451aed563a5e4c19aa69706aa311cfdaf5db5e9b0a167d814

3 weeks agoAdd the --blob-quote option to the ".mode" command in the CLI.
drh [Mon, 24 Nov 2025 18:31:13 +0000 (18:31 +0000)] 
Add the --blob-quote option to the ".mode" command in the CLI.

FossilOrigin-Name: 76a986b10d284b25915a07b7150ef1b85f4ef7d48d4e5315b13e7d1532cb97f1

3 weeks agoFix a typeof check so that it works in Worker threads.
stephan [Mon, 24 Nov 2025 18:17:07 +0000 (18:17 +0000)] 
Fix a typeof check so that it works in Worker threads.

FossilOrigin-Name: 3f2ed39e40e9c76c7d035b819d06c316ec4fba4e112b8a293822a8648147594b

3 weeks agoHave kvvfs enforce ASCII-only names to avoid truncating multibyte characters in kvvfs...
stephan [Mon, 24 Nov 2025 18:08:25 +0000 (18:08 +0000)] 
Have kvvfs enforce ASCII-only names to avoid truncating multibyte characters in kvvfs's key buffer.

FossilOrigin-Name: 03cb2a13c7f9081132390b5169cf22ffeced6ebdc5f01654360f951720310916

3 weeks agoChange some 32-bit integers in fts3_write.c to 64-bit to reduce the chances of intege...
dan [Mon, 24 Nov 2025 17:44:17 +0000 (17:44 +0000)] 
Change some 32-bit integers in fts3_write.c to 64-bit to reduce the chances of integer overflow.

FossilOrigin-Name: 8f8a7224c1e0173764757d5022de60abec3babdc3d4131632805e0b04d1a65bf

3 weeks agoAdd the QRF_BLOB_Size encoding for BLOBs in QRF.
drh [Mon, 24 Nov 2025 16:46:08 +0000 (16:46 +0000)] 
Add the QRF_BLOB_Size encoding for BLOBs in QRF.

FossilOrigin-Name: bafff695d34202377b937cb4ca9f8a7611ae286d9ab927e6c71faa3cd99496e5

3 weeks agoAvoid an assert() failure caused by processing a CREATE TABLE AS ... command that...
dan [Mon, 24 Nov 2025 16:04:07 +0000 (16:04 +0000)] 
Avoid an assert() failure caused by processing a CREATE TABLE AS ... command that generates very long column names.

FossilOrigin-Name: 06554a079d6b299986fc5eeb201595fad14f77c0efcf2d65bd2f36bbc325892c

3 weeks agoAvoid signed integer overflow that may occur in a non-default build when processing...
dan [Mon, 24 Nov 2025 15:40:10 +0000 (15:40 +0000)] 
Avoid signed integer overflow that may occur in a non-default build when processing a very large CREATE TABLE AS ... statement.

FossilOrigin-Name: b7417497d1fdbf588a8aca8499d27dee560d728a1eafbf44b34fe3b119423d98

3 weeks agoGet kvvfs v2 storage import working by disallowing it when there are opened db/journa...
stephan [Mon, 24 Nov 2025 15:17:52 +0000 (15:17 +0000)] 
Get kvvfs v2 storage import working by disallowing it when there are opened db/journal handles. Move import/export out of the JsStorageDb class and into sqlite3_js_kvvfs_import/export_storage().

FossilOrigin-Name: c9e0b32278290baf987b5a46bd47358439e3d0f190b2879a965d6e4262ea7baf

3 weeks agoShow just the list of available modes and omit the current mode display
drh [Mon, 24 Nov 2025 13:26:06 +0000 (13:26 +0000)] 
Show just the list of available modes and omit the current mode display
for the ".mode --list" command in the CLI.

FossilOrigin-Name: b9b2761fe79d9cc52365eef6bc34c7442972c5410517ff69926397cc7974ae33

3 weeks agoIn the CLI on the ".mode" command, replace the recently added --no-limits option...
drh [Mon, 24 Nov 2025 13:24:58 +0000 (13:24 +0000)] 
In the CLI on the ".mode" command, replace the recently added --no-limits option with
"--limits L,C".  And add --sw as an alias for --screenwidth.

FossilOrigin-Name: cff0978587a4193b57b0384a587bf89174be2fd91cff4d40130babef1dc8431e

3 weeks agoDoc typo fix.
stephan [Mon, 24 Nov 2025 13:22:26 +0000 (13:22 +0000)] 
Doc typo fix.

FossilOrigin-Name: d96cc772f0423f3f2b6ee0b0fb3d7e133cc4981cc7be76527a6d43792ece74e2

3 weeks agoAdd the fail-on-malloc()-error patch to the autosetup maintenance docs.
stephan [Mon, 24 Nov 2025 13:10:23 +0000 (13:10 +0000)] 
Add the fail-on-malloc()-error patch to the autosetup maintenance docs.

FossilOrigin-Name: 526b88fb9b270e780660b97fc14f41583885a3d801f0ed17e0e35ebd61749b26

3 weeks agoChange our local copy of the third-party jimsh0.c program (used only
drh [Mon, 24 Nov 2025 11:00:02 +0000 (11:00 +0000)] 
Change our local copy of the third-party jimsh0.c program (used only
during the build process) so that it prints an error message and
exits if malloc() fails.  This does not fix any actual bugs nor make
the build process any "safer", but it might help prevent bothersome
warnings from pedantic static analyzers.

FossilOrigin-Name: 72c8a5b94cdf5da7e2b197e02c9d5d98fe415cd731c3893acf3ba69bb4dde37a

3 weeks agoAdd the long-missing sqlite3_next_stmt() binding to JS/WASM.
stephan [Sun, 23 Nov 2025 22:18:26 +0000 (22:18 +0000)] 
Add the long-missing sqlite3_next_stmt() binding to JS/WASM.

FossilOrigin-Name: de27d2d3f2353309227b4d5f77eff76c108c094b61ac59f5a769229a084f2567

3 weeks agoMore work on kvvfs v2. Db imports work, in the sense that the storage is properly...
stephan [Sun, 23 Nov 2025 22:13:42 +0000 (22:13 +0000)] 
More work on kvvfs v2. Db imports work, in the sense that the storage is properly replaced, but the native side is not yet able to recover from that (and how to make it able to do so is not clear).

FossilOrigin-Name: 4857c9d2fe428c19319244bf0589eaf93c124f020a633d6b7d40d35aaf969d24

3 weeks agoAdd the long-missing sqlite3_next_stmt() binding to JS/WASM.
stephan [Sun, 23 Nov 2025 22:09:16 +0000 (22:09 +0000)] 
Add the long-missing sqlite3_next_stmt() binding to JS/WASM.

FossilOrigin-Name: 53a99ff4ed5ef5f8620bf324a4f7a1d0812f5c80311228eb820039430ca04bd5

3 weeks agoDocs, cleanups, and dead code removal.
stephan [Sun, 23 Nov 2025 20:05:21 +0000 (20:05 +0000)] 
Docs, cleanups, and dead code removal.

FossilOrigin-Name: 49db59aa9c74e49d878adc8671b0d32db8f1f898bde29d046ce0e368d8987868

3 weeks agoGet the kvvfs v2 working in 64-bit wasm builds (a 0 vs null vs BigInt issue).
stephan [Sun, 23 Nov 2025 16:54:16 +0000 (16:54 +0000)] 
Get the kvvfs v2 working in 64-bit wasm builds (a 0 vs null vs BigInt issue).

FossilOrigin-Name: 4811742688bd8ae847c0a13ca9b395b2d2edd24ce4e7760a5d1b0adf1c7f332d

3 weeks agoEliminate the superfluous 'kvvfs-' part of keys for transient storage and cleanup...
stephan [Sun, 23 Nov 2025 16:35:18 +0000 (16:35 +0000)] 
Eliminate the superfluous 'kvvfs-' part of keys for transient storage and cleanup their export a bit. Reminder for later: we could potentially use the dbpage vtab to serialize any db to this JSON-friendly form.

FossilOrigin-Name: f63014f70febf82976a99f9f1ce6d793e2ca8d1dd2f72622152b64b2d65f8adc

3 weeks agoInitial work on eliminating the superfluous-for-transient-storage kvvfs key prefixes...
stephan [Sun, 23 Nov 2025 15:38:34 +0000 (15:38 +0000)] 
Initial work on eliminating the superfluous-for-transient-storage kvvfs key prefixes and implementing kvvfs db import.

FossilOrigin-Name: 6bc64059410b1868b7a3576e16d03c02e7c007a2be8b313e386eeb2e2a35c258