1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-20 01:22:32 +03:00
Commit Graph

638 Commits

Author SHA1 Message Date
drh
cedefd21de Merge the latest trunk enhancements into the reuse-schema branch
FossilOrigin-Name: 0a4c8b093c649e7dcec21260e69737de9604e47b771fa6bdb8cd1f8bcb0de90f
2025-11-28 21:00:59 +00:00
stephan
961665682b Minor doc updates.
FossilOrigin-Name: 66b0f28958311204270053ef1d5e66c0ad04e3a52f2570c543b6d319d75798fa
2025-11-28 16:23:24 +00:00
stephan
f26c99005a 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
2025-11-28 02:34:08 +00:00
stephan
6003505a39 Cherry-pick JS fixes/cleanups/docs from [206275292217], [256c1dd2c367], and [dec0c6073cc1] from the kvvfs-v2 branch into trunk.
FossilOrigin-Name: cdd3e700f59e5c30241cd5c6d9ea31f6a5f1c7130c6341b4e0b6dc32b06f3c79
2025-11-25 19:29:23 +00:00
stephan
f37923e723 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
2025-11-25 19:20:15 +00:00
stephan
9101b90159 Add the long-missing sqlite3_next_stmt() binding to JS/WASM.
FossilOrigin-Name: de27d2d3f2353309227b4d5f77eff76c108c094b61ac59f5a769229a084f2567
2025-11-23 22:18:26 +00:00
stephan
2fcc13f8c9 Cherrypick [0b53be562f1e] into trunk.
FossilOrigin-Name: e86e5723d778721b10c1c908545c56233d4d5549a7ca3b7cf8ca649c70450add
2025-11-22 19:29:23 +00:00
stephan
794a9b48ac Add new file missing from [3c4061428544].
FossilOrigin-Name: 41f94eca01d8317364aa60ddd8e5fe3cd21a215040ef271a157d450a914139d0
2025-11-21 15:03:38 +00:00
stephan
40ce52a4e5 Move the JS pieces of kvvfs into their own file to facilitate pending feature experimentation.
FossilOrigin-Name: 3c40614285449df259a3444e36f888cfb5e782ea58287914f97f496ea61e9e9f
2025-11-21 10:49:32 +00:00
stephan
6d62ed4f87 Remove an extraneous loop level from the JS bootstrapping bits.
FossilOrigin-Name: 86817b4e9f011d296fb420be95269fecb54fb48a220bce84020e3af2d2c164a4
2025-11-20 12:14:03 +00:00
stephan
df3fca8da4 Enable the SQLITE_EXPERIMENTAL_PRAGMA_20251114 in the WASM builds for the sake of VFS experimentors. The links in the comments describe what that does.
FossilOrigin-Name: aaa55a3ebf8e725443030be5f31ac7fc0766c1f3c771ce69852f31e7e6f165b9
2025-11-20 12:12:55 +00:00
drh
3432c86eaf Merge the latest trunk changes into the reuse-schema branch
FossilOrigin-Name: 3cffc5181ca9fe1ab7f5768c385e3c0460d593549f59fc71540b9c1689093550
2025-11-18 19:09:01 +00:00
stephan
393a4d8ac5 Reorder initialization of sqlite3ApiBootstrap()'s bownstrapped config object so that it's possible to inject the wasm memory and exports via that, to simplify plugging-in of sqlite3-api.js in other builds. Previously the build-provided wasm exports/memory overrode any which a client might want to use.
FossilOrigin-Name: 2bd0addb6068cd2b34f6151a824c578e2253f541a8c55b578219b09c42afd82b
2025-11-15 11:53:30 +00:00
stephan
987870a6a0 Generic internal JS cleanups towards improving portability of sqlite3-api.js to other build systems.
FossilOrigin-Name: 5bc37e5c2fcd83fd0bc40234144072363f1cbf7d811a15b74a0991e397a35eb8
2025-11-15 11:30:45 +00:00
stephan
a804a65617 Move sqlite3-api-cleanup.js into post-js-footer.js to remove the final direct Emscripten dependency from the intermediary build product sqlite3-api.js (the whole library, waiting to be bootstrapped). This is partly in response to [forum:4b7d45433731d2e0|forum post 4b7d45433731d2e0], which demonstrates a potential use case for a standalone sqlite3-api.js. This is a build/doc change, not a functional one.
FossilOrigin-Name: 2fcbd8e17d8f1dd7e9d45168805dba718777e46803d9375a4212296d3d0cd89c
2025-11-15 09:19:03 +00:00
stephan
e1f7ec65fd Slight restructure of the previous checkin.
FossilOrigin-Name: 8ff98747c072c8c333b1b37cf4ec9344e84f081bd4e6d3b5e75f37b1e1ce9e84
2025-11-14 17:23:24 +00:00
stephan
505d8a43db In sqlite3-api-cleanup.js, if no Emscripten module is detected then simply return, rather than throw. This should enable the generated sqliet3-api.js (normally an intermediary file) to be used as-is, with the caveat that the caller has to bootstrap the library themselves.
FossilOrigin-Name: d64c9cd4c7a1ffe04de6c75126563d7bbb24266e13d41406f6d55720b8199037
2025-11-14 16:56:51 +00:00
stephan
319870836c JS code reformatting and doc updates. No functional changes.
FossilOrigin-Name: c566c653e4f55afa0660e819ed5b1fd96cb9b24bc78c333adcd8825331a9dd26
2025-11-13 15:33:44 +00:00
stephan
f47095a5a0 Teach c-pp to export its argv as a #define list so that we can embed it in the generates files.
FossilOrigin-Name: 42f95ea71e5e7e927685de3a6da2ede38abe7cabdd1fc71b9a14bebe9f54a65e
2025-11-13 08:26:11 +00:00
stephan
ce53b80819 Minor doc correction and a JS error message tweak.
FossilOrigin-Name: c4ae21c89e5fd40eefd4916df6c6a6c4e27075a434a9d47576d3fcfbc7720588
2025-11-13 06:49:12 +00:00
stephan
b867030b1a Clarify that 'pikchr' is not a typo.
FossilOrigin-Name: d7bb2ee6ec23c266c887fb2aeb77b0b17cd8f1429564d341537f57c5478410e2
2025-11-12 17:25:17 +00:00
stephan
73caea1764 Reworking of JS internals to support binding of nested C structs (like sqlite3_index_constraint and friends) and allow some of the automated JS/C conversions to be plugged in at the struct-binding level, simplifying how struct members, in particular function pointers, can be used from JS.
FossilOrigin-Name: bb4fd5b789cebf2b224c29023fea3e620a86fb36730c36c0d85d9f35880bf643
2025-11-10 07:41:54 +00:00
stephan
c55d8262cf In sqlite3.wasm.allocFromTypedArray(), swap the order of the allocation and the access to the heap view object to work around an obscure issue when allocating huge blobs. The heap view object could previously become stale via the following allocation if the underlying WebAssembly.Memory object needed to grow. Essentially a realloc()-moves-the-pointer situation but it only comes up with huge allocations under the right circumstances and would trigger a JS exception (as opposed to corrupting the WASM heap). Problem reported in [forum:05b77273be104532|forum post 05b77273be104532].
FossilOrigin-Name: 0f712b6b0516dc151d3bcbb63497661c82e11eae368e639bbdf197e1b3467195
2025-11-09 06:32:10 +00:00
stephan
bb3b269ba9 Add new file missing from [936990cf067a5ebb] (and subsequently deleted by fossil clean -x). Have speedtest1 wasm use the user-provided sqlite3.c, rather than forcing the canonical one, so that the wasm exports don't have to be re-generated for that special case. Remove a harmless duplicate -D... flag.
FossilOrigin-Name: 7a592f5cd09699b45051855f6d477def40220b17642cbdb0f35ed74dd32becf1
2025-11-03 21:26:27 +00:00
stephan
c129de05bb Simplify the EXPORTED_FUNCTIONS lists to use the preprocessor instead of per-list shell commands. (Unrelated) Remove part of the post-compilation JS filtering which breaks with emsdk 4.0.16+, which means the .js files are about 57kb bigger than they really ought to be.
FossilOrigin-Name: 936990cf067a5ebb34f7f662fc2d23d468c50f179afafe47fe0d2ed775f5ef74
2025-10-30 20:18:20 +00:00
stephan
bc5e0be7f8 A experiment addressing the embedded-NUL behavior of sqlite3_colum/value_text() in the JS bindings, as discussed in [forum:d77281aec2df9ada|forum post d77281aec2]. This is an experiment only. It works, in that existing tests do not see the difference, but it has implicications which require careful consideration before deploying.
FossilOrigin-Name: d0e803b90344ee972e4b3fb30b77e283599dc4d5c6a3335ce9fea653a1b3f6f0
2025-10-30 02:21:38 +00:00
drh
4db3453794 Merge the latest trunk enhancements into the reuse-schema branch.
FossilOrigin-Name: a0c3f3d00d035fc9042cd713ec7787684701299d27439f4695de78f4f8f5c4ef
2025-10-27 12:20:22 +00:00
stephan
02c5f3976f Random tiny tweaks in internal JS and flesh out the tester1 test selection list to include both 32-/64-bit entries for all tester1XYZ.html combinations. For after the 3.51 release.
FossilOrigin-Name: c087a1d23deac84ac46e769332ec167c5b38fc8e525fd90484d3fa0b6d304ffa
2025-10-24 21:01:23 +00:00
stephan
e826aa8e00 Minor JS doc updates. No code changes.
FossilOrigin-Name: fc2a026901b1a12526b92fff36d7acc226e554c9f351e6261c7ffd4887bcc337
2025-10-15 23:28:31 +00:00
stephan
d6cb2ccee6 JS/WASM: Expose sqlite3_db_status64(), sqlite3changeset_apply_v3(), sqlite3changeset_apply_v3_strm(), and SQLITE_DBSTATUS_TEMPBUF_SPILL.
FossilOrigin-Name: b13eafc9b6820517b450041a7e2be573a896b5b9e88b2b28df9f15e3cb91e23d
2025-10-14 18:23:32 +00:00
stephan
b4fdfc2f9a Update c-pp.c and rename it to c-pp-lite.c to match its new upstream name. Adapt the JS files and mkwasmbuilds.c for c-pp syntactic changes.
FossilOrigin-Name: bb13e46ddfcd1d3ca73845430d9a91c0ea3913762d39bbd94127783d77e4f63b
2025-10-09 15:28:59 +00:00
stephan
0df9db4921 Make use of the new SQLITE_ENABLE_PERCENTILE in the wasm build.
FossilOrigin-Name: 937c084c2d9b20fde2d54e48257cb7018bd8c36d6f00ed6f1659b5ecc2f48ed4
2025-10-08 18:17:19 +00:00
drh
f07e922932 Merge the latest trunk enhancements into the reuse-schema branch.
FossilOrigin-Name: 8959f0e167cc83727d9f4b86ba52a04c25bfe931310482aa1803fc763203de44
2025-09-30 19:56:38 +00:00
stephan
436c8e5026 Remove the long-defunct wasmfs build of speedtest1 from index.html and re-enable the wasmfs scratchpad app (which still works). Fix the CFLAGS for the wasmfs build and the path to the wasm file for one of the JS.
FossilOrigin-Name: acaaf8cce9e780bf937436b4c987ed284aa0bba6f5ca9508d9dbad598af2991d
2025-09-28 18:03:29 +00:00
stephan
0b0c8734f3 Improve #if support in, and add #assert to, c-pp. Rename target=... preprocessor symbols to target:... because changes in the semantics for symbols which have an '=' makes some of those #if blocks mutually exclusive (which we won't want in rare cases involving the bundler-friendly builds).
FossilOrigin-Name: 54287487793d48f6dde919446ab7476aea0cc0aba3835c80f060a7b84221881a
2025-09-28 00:53:00 +00:00
stephan
96c753ec56 Reinstate the Module.instantiateWasm() override and simplify how the wasm filename gets injected into the JS files.
FossilOrigin-Name: e878ffd2eaa87e2978c44fcd03a1eb6114a9ae31e31101898d682f43cf81000f
2025-09-26 17:11:39 +00:00
stephan
c1254430d8 Build cleanups and dead code removal.
FossilOrigin-Name: b516109e5accc885b71900402c800ae855407552648861334c895f0e5dea4ee5
2025-09-26 01:38:07 +00:00
stephan
6d3ae03f1e Get the tester1 worker1/promiser demos building again. Show WASM heap usage in tester1 if.
FossilOrigin-Name: 6691a84872f823c95b0bdc3db8e12d21c9561aa1e1ce1d787a977f2c5ef8225a
2025-09-24 20:39:08 +00:00
stephan
5c01f3fb83 Further wasm build refactoring. Get speedtest1 building again.
FossilOrigin-Name: 5434307dcd927686ce827da22de55020c4b431f888ac81ae3634d458ad0b563d
2025-09-24 06:43:24 +00:00
stephan
a8bddde325 Slight correction to the diagram in the previous checkin.
FossilOrigin-Name: 6455af2703e78fb9b6df19cf4b46873d98ec91c3302dc0093a362d03ac48da91
2025-09-23 00:24:58 +00:00
stephan
b19c14742d Add a high-level diagram showing how sqlite3.js gets assembled.
FossilOrigin-Name: e0dfa1e62ba6d71abe1f48969eb6f53c83f2c28d47b996ee223587d923cc282f
2025-09-22 23:48:05 +00:00
stephan
e55a29f5fd Refactor and simplify the JS API bootstrap steps.
FossilOrigin-Name: a4f36fd93738f985d2c757c69eddca092732ce6148af98eb2595f9abe0d4fa44
2025-09-22 21:04:24 +00:00
stephan
cfa48c17f7 Update ext/wasm/api/README.md for recent changes.
FossilOrigin-Name: 03b70686939e5f9ad984220a31674c23a1beb19f040c6327f24e23f0378555da
2025-09-22 18:05:10 +00:00
stephan
1ab3d7eafd Cleanups and docs in the internal parts of the JS lib bootstrapping. More tinkering with the custom (but still disabled) wasm file loader.
FossilOrigin-Name: 35651d9ab5529da915500fc50ca3833a004d0b7a19d98e8fbf39234d94697aec
2025-09-22 17:29:52 +00:00
stephan
34d92f4ac6 Minor doc updates. No functional changes.
FossilOrigin-Name: 9c67299b452a2b19b5f4285feb975b30864a9415ccf62b7c7ebb1587a6545b33
2025-09-22 11:52:06 +00:00
stephan
5a2e3c4af2 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).
FossilOrigin-Name: e5f0256feab95c30a8e3e1e69963fb3e25ed2da296aff5bc6646fe96a76c0b81
2025-09-22 02:40:06 +00:00
stephan
1e01174ac3 A minor optimization in wasm.realloc().
FossilOrigin-Name: 6a070f450ac9ee3d4d6a3e05ef8fa2071a684181ea160805e236c3bba226510a
2025-09-21 22:17:13 +00:00
stephan
589855f40e Improve db-close-time cleanup in the face of WASM environments which wrap wasm.exports in nullary wrappers.
FossilOrigin-Name: fbb63634eab83fda0090fe2c38bda735b497fd6e57dd36344559962e396dbb17
2025-09-21 21:37:44 +00:00
stephan
e6db55f0e2 Fix a Number/BigInt descrepancy in oo1.DB() when passed a WASM-string db filename. Consolidate some duplicated internal code and adjacent minor cleanups.
FossilOrigin-Name: d078aff7817ccd4f891024e55703519307a53815d472086bf3d42b2be28698b3
2025-09-21 21:17:41 +00:00
stephan
b10548a7b0 General cleanups and dead code removal.
FossilOrigin-Name: 0336fa95e15c53ac6ab8152a840163a5aac64725874ffb848ce1d95e3af90586
2025-09-21 19:39:06 +00:00