drh [Wed, 1 Jun 2022 11:05:59 +0000 (11:05 +0000)]
Move the sqlite_offset() function implementation to be an in-line function,
thereby avoiding special case code and freeing up a bit in the
FuncDef.flags field.
stephan [Wed, 1 Jun 2022 08:09:06 +0000 (08:09 +0000)]
Initial proof of concept code for a JavaScript binding which runs in the main window thread but acts on a db handle running in a Worker thread. Expanded the DB.exec() and DB() constructor to simplify certain use cases.
stephan [Tue, 31 May 2022 02:03:29 +0000 (02:03 +0000)]
Updated the wasm builds to generate gzip'ed copies of relevant files to take advantage of althttpd's new capability of substituting gzip files in place of requested files. This cuts over-the-wire size of the fiddle app by more than half.
drh [Mon, 30 May 2022 17:33:22 +0000 (17:33 +0000)]
For an outer join, then ON-clause constraints need to be evaluated at just
the right moment - not too early and not too late. Fix for the problem
reported by [forum:/forumpost/3902c7b833|forum post 3902c7b833].
stephan [Sat, 28 May 2022 11:59:46 +0000 (11:59 +0000)]
fiddle: changed the internal key of the session/local storage to avoid conflicts with the pikchr fiddle app (which is derived from this one) when running from the same HTTP origin as an instance of that app in a dev environment.
stephan [Fri, 27 May 2022 03:27:10 +0000 (03:27 +0000)]
fiddle: added an option to completely wipe/reset the db. The Options area can now be toggled on/off via tapping the label at its top. Running the input SQL is now limited to the selected area if any text is currently selected, per suggestion in the forum.
stephan [Thu, 26 May 2022 05:08:25 +0000 (05:08 +0000)]
Makefile.in: added explanations, intended for maintainers and hackers, of the various emcc flags used for building the wasm files. No code or build rule changes.
drh [Wed, 25 May 2022 12:49:59 +0000 (12:49 +0000)]
Do not allow the right operand of a RIGHT JOIN to be reordered with other
FROM clause terms that are even further to the right. Fix for the issue
identified by [forum:/forumpost/5cfe08eed6|forum post 5cfe08eed6].
stephan [Wed, 25 May 2022 08:51:07 +0000 (08:51 +0000)]
Got the sqlite3-api JS bits wrapped up in deferred-load module. Whether that's going to be easier to use, in practice, remains to be seen. Consolidated two of the test-related JS files.
stephan [Tue, 24 May 2022 22:16:12 +0000 (22:16 +0000)]
fiddle: added support for exporting (downloading) the current db file. To do this we had to fall back to named dbs, instead of defaulting to an in-memory one, but the virtual filesystem is an in-memory FS, so the end effect is the same.
drh [Tue, 24 May 2022 16:05:41 +0000 (16:05 +0000)]
When an ON clause on an INNER JOIN references a table to the right of
of the join, just convert the ON clause to an ordinary WHERE clause term,
in order to be compatible with older versions of SQLite. See
[forum:/forumpost/687b0bf563a1d4f1|forum thread 687b0bf563a1d4f1] for details.
stephan [Tue, 24 May 2022 14:36:45 +0000 (14:36 +0000)]
fiddle: lots of generic refactoring, restructuring, and cleanup in the higher-level code. Added push-fiddle ext/fiddle/Makefile target to push the fiddle app to a remote server via rsync.
drh [Mon, 23 May 2022 12:37:54 +0000 (12:37 +0000)]
New test cases to further demonstrate the difference in name matching rules
for LEFT JOIN versus RIGHT JOIN that protect legacy behavior.
[forum:/forumpost/e90a8e6e6fa652ac|Forum thread e90a8e6e6fa652ac].
drh [Mon, 23 May 2022 10:57:20 +0000 (10:57 +0000)]
Do not run the subroutine that materializes a view or subquery until just
before the materialization is actually needed, so that if the materialization
turns out to never been needed, unnecessary work can be avoided.
stephan [Mon, 23 May 2022 01:11:49 +0000 (01:11 +0000)]
WASM: removed the in64-related bindings, as MDN says that calling a wasm function which has an int64 type in its signature will currently throw because JS has no 64-bit integer support. Those bindings now use doubles and simply hope that the user doesn't exceed their integer precision (2^53-1, approx 9 quadrillion).
stephan [Sun, 22 May 2022 19:09:59 +0000 (19:09 +0000)]
Implemented Stmt.get() and friends for WASM OO #1 wrapper. Added basic tests for prepare/step/get. Restructured module init output to introduce only 1 global-scope symbol instead of 2.
stephan [Sun, 22 May 2022 16:25:43 +0000 (16:25 +0000)]
WASM: added bindings for sqlite3_compileoption_get/used(), moved OO #1 into sqlite3-api.js since it can only be used from the same thread as that API and separating them complicates client-side use. Started adding test utilities and tests for the OO1 API.
stephan [Sun, 22 May 2022 00:27:19 +0000 (00:27 +0000)]
Build refactoring for the fiddle/wasm bits. Set up wasm binding of a chunk of the core C API and added some infastructure for creating test pages for it.
stephan [Sat, 21 May 2022 21:13:44 +0000 (21:13 +0000)]
Minor fiddle-related build restructuring to support upcoming development of the C-style wasm sqlite3 interface, plus some commentary about the plans and goals for that.
drh [Sat, 21 May 2022 15:12:41 +0000 (15:12 +0000)]
Use the newer OP_BeginSubrtn opcode instead of OP_Integer to start the
subroutine used to matrialize a view. This does not change execution but
does make the byte code a little easier to read.
stephan [Sat, 21 May 2022 14:19:05 +0000 (14:19 +0000)]
fiddle: refactor into main thread (UI) and worker thread (wasm module). Added bits needed to support triggering sqlite3_interrupt() but do not yet have a second SharedWorker to test it with.
stephan [Sat, 21 May 2022 00:01:45 +0000 (00:01 +0000)]
In the shell WASM build, call open_db() early so that we can get access to the global db handle from certain experimentation-only function without having to first run some SQL code.
stephan [Thu, 19 May 2022 16:49:15 +0000 (16:49 +0000)]
When building fiddle from its own directory (e.g. from emacs instead of the normal build process), force -O0 the sake of compilation speed. The top-level build now defaults to -Oz, which is more appropriate for that case.
stephan [Thu, 19 May 2022 15:58:13 +0000 (15:58 +0000)]
Numerous layout tweaks, the most significant being that the layout now adapts to the window size. Swapped positions of the input/output areas. This version supports, by uncommenting a few bits, a jquery.terminal-based view but alternatives to that 300kb dependency are still under investigation.
stephan [Thu, 19 May 2022 10:38:54 +0000 (10:38 +0000)]
Ensure that the output area is cleared of any init-time messages which the emscripten bootstrapping process emits when downloading of the wasm module is slow.
stephan [Thu, 19 May 2022 09:55:14 +0000 (09:55 +0000)]
Split the fiddle JS code into separate pre-/post-init files to simplify editing. emcc will combine these into the final fiddle.js, so the number of output deliverables does not change.
stephan [Wed, 18 May 2022 22:58:34 +0000 (22:58 +0000)]
In wasm builds, ifdef out shell commands which require file I/O, pipes, or which trigger an exit() (.quit and .exit). Documented some of the quirks and limitations of the C/WASM crossover. Keep the JS code from calling into the C code after an exit() has been triggered.
stephan [Wed, 18 May 2022 21:18:21 +0000 (21:18 +0000)]
Improved handling/reporting of conditions which trigger an exit() from native code, e.g. calling the '.read' command. Added a Help button which simply submits the '.help' command. Added commented-out variants of various -Ox flags to simplify experimenting with them.