Add new table-valued functions jsonb_each() and jsonb_tree() that work just
like json_each() and json_tree() except that the "value" column is JSONB
instead of JSON text when the "type" is 'object' or 'array'.
stephan [Thu, 25 Sep 2025 15:17:58 +0000 (15:17 +0000)]
Overhaul the wasm build to (A) support more coexisting variants, e.g. 32/64-bit of both vanilla and esm, and (B) build each variant to its own subdir so that they can build in parallel. It can, with make -j4, now build all new variants in half the time it previously took for just the 32-bit builds. The new build logging output, though unconventional, serves two purposes: (A) improve my build-time situational awareness and (B) it help demystify some of the build steps and output files.
Convert the ShellText object in the CLI to use sqlite3_malloc64() rather than
plain malloc(). Avoid unnecessary quoting of table names in .dump output
and similar. Improved detection of OOM in set_table_name().
dan [Thu, 25 Sep 2025 10:50:11 +0000 (10:50 +0000)]
Avoid an integer overflow ([forum:/forumpost/b3abe06121 | forum post b3abe06121]) and a compiler warning ([forum:/forumpost/3db6aa9ed6 | forum post 3db6aa9ed6]) in the shell tool code.
stephan [Wed, 24 Sep 2025 23:07:45 +0000 (23:07 +0000)]
Move the static makefile code from mkwamsbuilds.c into the makefile. Move util.make back into the main makefile. Remove a bunch of dead makefile code and docs.
Special case the "decimal(-0.0)" output to show exactly 0.0, just as it
does for positive zero.
[forum:/forumpost/adc719d88d56ab22|Forum post adc719d88].
Restrict the size of the LIMIT on a generate_series() query to avoid
an integer overflow when computing the final output value.
[forum:/forumpost/479bfb0d3b|Forum post 479bfb0d3b].
stephan [Wed, 24 Sep 2025 06:59:47 +0000 (06:59 +0000)]
In speedtest1, always use fatal_error() to exit fatally, instead of an fprintf/exit() pair, so that stdout/stderr get flushed consistently (which is significant for the WASM build).
Improvements to short-circuit evaluation of AND and OR operators.
This is a partial and incomplete response to
[forum:/forumpost/f5adeb59ff77c056|forum post f5adeb59ff77c056].
In the ieee754 extension, render -0.0 as 'ieee754(-1,-3071)' instead of
'ieee754(1,-3071)' as that makes the sign clearer. Both strings still
convert back to -0.0. Note that negative zero
and positive zero are distinct values in ieee754.
[forum:/forumpost/1eab7e4a08|Forum post 1eab7e4a08].
stephan [Tue, 23 Sep 2025 05:10:19 +0000 (05:10 +0000)]
Start reworking the wasm build (again) with an eye towards simplifying it. Currently only the canonical and esm builds work, not fiddle, speedtest, nor the bundler stuff.
stephan [Tue, 23 Sep 2025 02:04:07 +0000 (02:04 +0000)]
Add makefile target '64bit' to ext/wasm/GNUmakefile to build the 64-bit bundles. It does not yet generate copies of the test apps to load/test them, pending other reworking of the build.
Revise [a4430d262b3e129d] to preserve legacy behavior of the imposter
test-control. The control argument must be 2 now to get read-only behavior.
The control argument of 1 goes back to the prior read/write behavior.
stephan [Mon, 22 Sep 2025 13:13:02 +0000 (13:13 +0000)]
In wasm.ptr.coerce(), treat the undefined value the same as 0 for Number-type pointers for consistency with the BigInt coercion. The bindings have long treated both null and undefined as === 0 for pointer operations.
stephan [Mon, 22 Sep 2025 11:41:15 +0000 (11:41 +0000)]
Rework the JS/WASM pieces for compatibility with both 32-bit and 64-bit WASM environments. This affects only the browser-side components, not the --with-wasi-sdk build nor the core library.
dan [Mon, 22 Sep 2025 10:48:10 +0000 (10:48 +0000)]
Fix a problem with handling of 4-byte utf-8 characters in the shell tool (not the sqlite library). Forum post [forum:/forumpost/184b372388 | 184b372388].
stephan [Mon, 22 Sep 2025 02:40:06 +0000 (02:40 +0000)]
Experimenting with a custom wasm loader, but don't enable it without an explicit build flag. The goal here is to make the WebAssembly.Module object available internally (the default loader hides it from us).
stephan [Sun, 21 Sep 2025 22:08:05 +0000 (22:08 +0000)]
Remove some stale makefile comments. Add a little widget to fiddle's toolbar which shows whether it's running in 32- or 64-bit mode. Reduce fiddle's starting memory to 8MB.
stephan [Sun, 21 Sep 2025 21:17:41 +0000 (21:17 +0000)]
Fix a Number/BigInt descrepancy in oo1.DB() when passed a WASM-string db filename. Consolidate some duplicated internal code and adjacent minor cleanups.
stephan [Sun, 21 Sep 2025 20:26:47 +0000 (20:26 +0000)]
Fix a StructType.dispose()/ondispose() memleak in Jaccwabyt bindings in 64-bit builds and update its docs for 64-bit additions. Remove the parts of tester1.js related to skipping specific tests in 64-bit builds.
stephan [Sun, 21 Sep 2025 00:59:23 +0000 (00:59 +0000)]
Resolve the non-functional 64-bit JS vtabs and VFSes. All wasm tests now pass on a 64-bit build. Investigation of the fiddle failure on a second db import is still pending.
stephan [Sat, 20 Sep 2025 22:11:19 +0000 (22:11 +0000)]
Add missing sqlite3_vtab::xIntegrity wasm mapping. Correct signatures for the (unused) xDlOpen and xDlError bindings. Disable OPFS-related tests in tester1.js in 64-bit builds.
stephan [Sat, 20 Sep 2025 22:10:59 +0000 (22:10 +0000)]
Add missing sqlite3_vtab::xIntegrity wasm mapping. Correct signatures for the (unused) xDlOpen and xDlError bindings. Disable OPFS-related tests in tester1.js in 64-bit builds.
stephan [Sat, 20 Sep 2025 20:23:59 +0000 (20:23 +0000)]
Further tweaks towards 64-bit wasm. Fiddle is failing intermittently from the C level when importing a db and it's not yet clear what's happening there.
stephan [Sat, 20 Sep 2025 20:17:17 +0000 (20:17 +0000)]
Improve deps handling of fiddle's gzipped output files to help avoid stale gz files during development (althttpd will prefer those over the uncompressed ones). Only compress the larger files, not the small html/js pieces.
dan [Sat, 20 Sep 2025 14:48:08 +0000 (14:48 +0000)]
If the file-system supports f2fs style atomic-writes, sync the directory after deleting a journal file in journal_mode=DELETE mode in synchronous=NORMAL or synchronous=FULL modes (as well as synchronous=EXTRA).