stephan [Mon, 29 Aug 2022 09:51:17 +0000 (09:51 +0000)]
Add begin/end comment markers to the test blocks in speedtest1 --script output to facilitate chopping up the output into chunks for JS-side processing.
stephan [Mon, 29 Aug 2022 08:04:55 +0000 (08:04 +0000)]
oo #1 api: correct a case where a null callback is called. Rename some vars for clarity. Increase wasm-side memory in order to be able to load the speedtest1 output.
stephan [Thu, 25 Aug 2022 13:27:52 +0000 (13:27 +0000)]
Consolidate oo1.DB.exec() and oo1.DB.execMulti() into oo1.DB.exec(). This is a bit less efficient but certainly easier for a client to deal with and lightens the maintenance burden.
stephan [Thu, 25 Aug 2022 11:39:12 +0000 (11:39 +0000)]
Refactor and expand the worker1 docs, consolidating them into the top of their file instead of scattered around the internals. Accommodate an API change from yesterday in demo-oo1.js.
stephan [Wed, 24 Aug 2022 20:57:37 +0000 (20:57 +0000)]
Change DB.exec() rowMode default from 'stmt' to 'array', per /chat discussion. Add DB.exec() rowMode option for fetching a specific column by name. Add result column names to worker1 exec() callback interface, as there's otherwise no way to get that info from a worker.
stephan [Wed, 24 Aug 2022 18:39:46 +0000 (18:39 +0000)]
Expand the worker1 'exec' op handling for per-row callbacks for API-level consistency and smooth some edges between worker1 core and worker1-promiser. Add worker1 'config-get' message to fetch the serializable parts of the sqlite3.config state. Improve the 'open' op's handling of the 'persistent' option (noting that we cannot yet test that case from a worker).
drh [Wed, 24 Aug 2022 17:59:00 +0000 (17:59 +0000)]
Add a mutex to the sqlite3_db_config() interface so that it is threadsafe
when two or more threads call it on the same database connection at the same
time.
stephan [Wed, 24 Aug 2022 14:50:10 +0000 (14:50 +0000)]
js: resolve the mysterious "extra" unhandled exception notification, caused by inadvertently forking one promise into two separate ones (failing to properly reassign a then() result). Fix a typo in new Worker 1 code which caused the DB(filename) name to be incorrect.
stephan [Wed, 24 Aug 2022 05:59:23 +0000 (05:59 +0000)]
More work on how to configure the sqlite3 JS API bootstrapping process from higher-level code. Initial version of sqlite3-worker1-promiser, a Promise-based proxy for the Worker API #1.
stephan [Wed, 24 Aug 2022 00:51:39 +0000 (00:51 +0000)]
The very basics of a Promise-based proxy for the Worker #1 API. Still requires considerable cleanup, testing, and a solution for the exec-callback-via-event-type-name problem.
stephan [Mon, 22 Aug 2022 13:34:13 +0000 (13:34 +0000)]
Refactor JS API amalgamation such that the bootstrapping/configuration is deferred until the whole amalgamation is available, to facilitate providing clients with a way to initialize the API with their own config (noting that we're still one small level of refactoring away from being able to actually do that).
drh [Mon, 22 Aug 2022 02:00:26 +0000 (02:00 +0000)]
Add the new internal interface sqlite3DbNNFreeNN(db,ptr) where both the
db and ptr parameters are guaranteed to be non-NULL. Use this where
appropriate to save more than 2 million CPU cycles on the standard
performance test.
drh [Sat, 20 Aug 2022 19:33:04 +0000 (19:33 +0000)]
Enhance the enforcement of SQLITE_VTAB_DIRECTONLY so that it applies to
DML statements within triggers. Do not allow DML stratements against
virtual tables within triggers unless either the virtual table is
SQLITE_VTAB_INNOCUOUS or PRAGMA trusted_schema is ON.
stephan [Thu, 18 Aug 2022 12:21:58 +0000 (12:21 +0000)]
javascript: rename and simplify DB.callInTransaction() as DB.transaction(). Add DB.savepoint(), which works the same as transaction() but uses savepoints. Correct concatenation of arguments to SQLite3Error to use spaces instead of commas. Test that demo-oo1.js works with persistent OPFS storage (output differs due to persistent rows, but the demo works).
drh [Wed, 17 Aug 2022 20:18:34 +0000 (20:18 +0000)]
In the ".dump" command of the CLI, if a schema statement ends with an
unterminated comment, try to terminate that comment prior to appending
the ";" at the end. [forum:/forumpost/d7be961c5c|Forum post d7be961c5c].
stephan [Wed, 17 Aug 2022 16:44:05 +0000 (16:44 +0000)]
Minor cleanups, reorgs, and doc updates for the JS APIs. Renamed sqlite3(-api)-worker.js to sqlite3(-api)-worker1.js, for symmetry with sqlite3-api-oo1.js.
stephan [Tue, 16 Aug 2022 16:16:25 +0000 (16:16 +0000)]
wasm: move another file and update testing1/testing2 to account for [e38d00c2b82d]. Disable wasmfs by default as it breaks the worker-based module loader (reason as yet unknown).
stephan [Tue, 16 Aug 2022 16:06:12 +0000 (16:06 +0000)]
wasm: disable shared cache mode by default. Experimentally move wasm-build generated files up one dir to rule the extra dir out as a problem for Emscripten-related worker-loading failures.
drh [Mon, 15 Aug 2022 18:36:08 +0000 (18:36 +0000)]
The new --script option to dbtotxt.c looks for an SQL script at the head of
the file and generates a CLI script that will construct the database then run
the SQL.
stephan [Sat, 13 Aug 2022 17:13:16 +0000 (17:13 +0000)]
Add worker-style variant of the tests added in [ae24ac0f7dd9], but building this with wasmfs causes them to throw inexplicable exceptions from the Emscripten glue (without wasmfs it builds and runs fine, but storage is not persistent).
stephan [Fri, 12 Aug 2022 17:57:09 +0000 (17:57 +0000)]
Build fiddle with WASMFS OPFS support and attempt to use it if available. It does not work because of an inexplicable exception in Emscripten-generated code and perpetually-locked db, but it's not yet clear why.
stephan [Wed, 10 Aug 2022 09:36:10 +0000 (09:36 +0000)]
wasm/fiddle refactoring part 1 of N: move fiddle app from ext/fiddle to ext/wasm/fiddle, which only contains files intended to be pushed to the live site. Disabled build of the non-fiddle wasm parts, pending a later step of the refactoring.
drh [Thu, 4 Aug 2022 17:15:00 +0000 (17:15 +0000)]
Fix a problem with the query optimizer for LIMIT/OFFSET queries when
underlying query is a UNION ALL and both arms of the UNION ALL are
subqueries with an ORDER BY clause. This bug was reported at
[forum:/forumpost/6b5e9188f0657616|forum post 6b5e9188f0657616]. The
problem was introduced in 2015 (SQLite version 3.9.0) by check-in
[4b631364354068af]. See also ticket [b65cb2c8d91f6685].
drh [Wed, 3 Aug 2022 15:58:44 +0000 (15:58 +0000)]
For an IN operator used with a RIGHT JOIN, use the number of terms in the
vector, not the number of equality terms, to size the column map.
dbsqlfuzz 14cfdad6ca45e607163f54049ddf5065183dc657.
drh [Mon, 1 Aug 2022 13:14:03 +0000 (13:14 +0000)]
In the xUpdate method of the GeoPoly virtual table, make sure that the
number of updated columns does not exceed the underlying implementation, even
if the virtual table object records an excess number of column in the nAux
field due to table constraints in the table definition.
Fix for the problem reported by
[forum:/forumpost/a096ab7d96bb057a|forum post a096ab7d96bb057a].