]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
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 agoAdditional defenses against using the ".open" command of the CLI in --safe
drh [Sat, 29 Nov 2025 18:59:58 +0000 (18:59 +0000)] 
Additional defenses against using the ".open" command of the CLI in --safe
mode.

FossilOrigin-Name: eec0b80e53bb54ee05a4903cfb967cc2914cdcc735f1218922a0f9c80399c3e8

2 weeks agoUpdate the documentation to sqlite3_str_finish(). That function might
drh [Sat, 29 Nov 2025 18:32:25 +0000 (18:32 +0000)] 
Update the documentation to sqlite3_str_finish().  That function might
not return NULL on an empty string now, if the empty string is created
through the use of sqlite3_str_truncate().

FossilOrigin-Name: b2e980ede581625e37701f54833e5615d31a1b821ddaf52a26798494f847e640

2 weeks agoHandle empty string values in columnar modes without NULL pointer
drh [Sat, 29 Nov 2025 18:18:15 +0000 (18:18 +0000)] 
Handle empty string values in columnar modes without NULL pointer
dereferences.

FossilOrigin-Name: 7927dbc5ebc76233325e45bd24181dbc5c3636e271f9352cf530f41dad6ba66d

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 agoFix an assertion fault in sqlite3Dequote() that can occur with
drh [Sat, 29 Nov 2025 12:06:12 +0000 (12:06 +0000)] 
Fix an assertion fault in sqlite3Dequote() that can occur with
ALTER TABLE DROP CONSTRAINT on a corrupt schema.
dbsqlfuzz 509a778e8a0c21a6448003feb773a1e55ed751e7.  Test case in TH3.

FossilOrigin-Name: 2dc73eb2d215178c448b182ebb227bc4753ad7baf46c8bd58f20a2b22e998726

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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

3 weeks agoAdd tests demonstrating basic concurrent use of kvvfs storage and that kvvfs still...
stephan [Sun, 23 Nov 2025 13:33:56 +0000 (13:33 +0000)] 
Add tests demonstrating basic concurrent use of kvvfs storage and that kvvfs still works after wiping the storage out from under it).

FossilOrigin-Name: cbbb9e61ae81097625488d78c5cbc0065c0acc3c8a7fd819490bc697f9d808c5

3 weeks agoBump kvvfs's sqlite3_vfs::iVersion to 2 so that its xCurrentTimeInt64() can be used...
stephan [Sun, 23 Nov 2025 12:14:18 +0000 (12:14 +0000)] 
Bump kvvfs's sqlite3_vfs::iVersion to 2 so that its xCurrentTimeInt64() can be used. Add JsStorageDb.exportToObject() to serialize a kvvfs to a JSON-friendly form.

FossilOrigin-Name: 393c1beee00ec3b3e98eb385cae0abeb1b34475140c0e8c3d57541d349904436

3 weeks agoReplace an alloc/free on every read of a JS kvvfs key with a one-time alloc and a...
stephan [Sun, 23 Nov 2025 11:28:27 +0000 (11:28 +0000)] 
Replace an alloc/free on every read of a JS kvvfs key with a one-time alloc and a long paragraph explaining why we have to leak it.

FossilOrigin-Name: 66fb9978f0a63887d214e895343adedfa46ee7aefccb8389d6d3af727e0a65ea

3 weeks agoNew test case for bSplitColumn in QRF.
drh [Sun, 23 Nov 2025 10:55:38 +0000 (10:55 +0000)] 
New test case for bSplitColumn in QRF.

FossilOrigin-Name: 6d01f9f49eef5f7d4bddadc458691b6ca36e277bae1d4b43b60a128a44e3faca

3 weeks agoIn QRF in bSplitColumn mode, increase the spacing between columns to be as
drh [Sun, 23 Nov 2025 00:45:47 +0000 (00:45 +0000)] 
In QRF in bSplitColumn mode, increase the spacing between columns to be as
wide as five, for improved legibility, if screen width allows.

FossilOrigin-Name: 673648cc812e1549c2b3e7749306e7395d0b7e396a7d5ac432948eb3a6c3713f

3 weeks agoUse the new "split" mode to simplify and improve the implementation of
drh [Sun, 23 Nov 2025 00:10:06 +0000 (00:10 +0000)] 
Use the new "split" mode to simplify and improve the implementation of
the ".tables" and ".indexes" commands in the CLI.  Fix a bug in QRF
that this new implementation found.

FossilOrigin-Name: b73df612b621699cd58de6ef327fefdeb8f52eb620f0d2df00d38ff6608a8dd5

3 weeks agoAdd "split" mode in the CLI. Fix CLI commands given on the command line
drh [Sat, 22 Nov 2025 23:34:53 +0000 (23:34 +0000)] 
Add "split" mode in the CLI.  Fix CLI commands given on the command line
so that they honor --once in prior commands.

FossilOrigin-Name: 2530f04d1bb02b800fda83544f5b5dcd42f52b3e56ad625cd03b40e42f24ac6b

3 weeks agoAdd the --no-limits option to the .mode command in the CLI.
drh [Sat, 22 Nov 2025 21:47:48 +0000 (21:47 +0000)] 
Add the --no-limits option to the .mode command in the CLI.

FossilOrigin-Name: 3cee168e8801481f6d909fb5d20a773b9c6ca0b8daedfc301c9d762a17f9d839

3 weeks agoIn QRF, change the name of the bWrapSnglCol flag to bSplitColumn.
drh [Sat, 22 Nov 2025 21:34:33 +0000 (21:34 +0000)] 
In QRF, change the name of the bWrapSnglCol flag to bSplitColumn.
Similar changes to the TCL interface.

FossilOrigin-Name: 76512b3b80fdcaae22340cde0b69857e2a4d7e86a63c6759465bd8a0bcbf82bc

3 weeks agoCherrypick [0b53be562f1e] into trunk.
stephan [Sat, 22 Nov 2025 19:29:23 +0000 (19:29 +0000)] 
Cherrypick [0b53be562f1e] into trunk.

FossilOrigin-Name: e86e5723d778721b10c1c908545c56233d4d5549a7ca3b7cf8ca649c70450add

3 weeks agoThis combination of kvvfs callbacks seems to work okay for both persistent and transi...
stephan [Sat, 22 Nov 2025 19:21:25 +0000 (19:21 +0000)] 
This combination of kvvfs callbacks seems to work okay for both persistent and transient storage, but it's unclear why/how, as xAccess() does not appear to be doing anything useful (and misbehaves when told to report that the storage object in question exists). These tests fail in 64-bit builds for as-yet-unknown reasons (other tests continue to pass in 64-bit).

FossilOrigin-Name: 69e591d0054218ead789cee199e5258f1c378a89e4b7b0e38fe74e834e23156b

3 weeks agoFix a misinteraction of CREATE/READONLY flags in the OPFS VFS.
stephan [Sat, 22 Nov 2025 17:27:16 +0000 (17:27 +0000)] 
Fix a misinteraction of CREATE/READONLY flags in the OPFS VFS.

FossilOrigin-Name: 0b53be562f1e1a5b20ffe8d72df64e753a8d759b580d949a0f32409144769bb0

3 weeks agoIgnore semicolons at the end of dot-commands, if the compatibility date is
drh [Sat, 22 Nov 2025 16:43:52 +0000 (16:43 +0000)] 
Ignore semicolons at the end of dot-commands, if the compatibility date is
20251115 or later.
[forum:/forumpost/72d084ed552|Forum thread 2025-10-09T21:12:32z]

FossilOrigin-Name: 7a9e753e977ff61ceee50c4e0e5f9b1fc179e91acd9ac88378c888b3e45ebe3a

3 weeks agoFix storage-size counting of non-local/non-session kvvfs storage. Rename the 'global...
stephan [Sat, 22 Nov 2025 16:29:45 +0000 (16:29 +0000)] 
Fix storage-size counting of non-local/non-session kvvfs storage. Rename the 'global' buildin kvvfs storage object to 'localThread'.

FossilOrigin-Name: 61606be2ae2b0d73cdcd7947a77c7ad87cdf850bba90b0c3e3cdf8c02177db73