dan [Tue, 2 Dec 2025 14:43:59 +0000 (14:43 +0000)]
Fix a problem with ALTER TABLE DROP COLUMN commands where the column being dropped is the rightmost in table and is immediately preceded by a comment containing a "," character.
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().
drh [Sun, 30 Nov 2025 23:09:24 +0000 (23:09 +0000)]
Tweaks to the wcwidth() algorithm in QRF, for better agreement with
the Terminal on Ubuntu. There is no perfect solution, as different
ttys do things differently, but we should try to get as close as we
can.
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).
stephan [Sun, 30 Nov 2025 07:25:59 +0000 (07:25 +0000)]
Add sqlite3_db_handle() to the list of functions which are guaranteed to preserve the current error state, per request in [forum:8e79e8ddd5|forum post 8e79e8ddd5].
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.
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.
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.
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().
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.
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.
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.
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.
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.
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.
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).
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.
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.
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]
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.
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].
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.
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).
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.
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.
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.
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.