aboutsummaryrefslogtreecommitdiff
path: root/ext/fiddle/sqlite3-api.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-06-06 04:09:44 +0000
committerstephan <stephan@noemail.net>2022-06-06 04:09:44 +0000
commit626aa48c268a0fa60efb467730785672b7e6d0e4 (patch)
tree4d995b3a4c33eb187558d77573c5c697d4e8df9a /ext/fiddle/sqlite3-api.js
parent93a4b411ef15de8540482a125ee744e4458ea67f (diff)
downloadsqlite-626aa48c268a0fa60efb467730785672b7e6d0e4.tar.gz
sqlite-626aa48c268a0fa60efb467730785672b7e6d0e4.zip
shell: in WASM mode, permit ATTACH because the filesystem is a virtual sandbox and ATTACH can be used to provide more import/export options. Minor doc updates in sqlite3-api.js.
FossilOrigin-Name: f28de5b726999b913b442fa51355d020ba1f1662d2f7978380623c16438eb238
Diffstat (limited to 'ext/fiddle/sqlite3-api.js')
-rw-r--r--ext/fiddle/sqlite3-api.js32
1 files changed, 27 insertions, 5 deletions
diff --git a/ext/fiddle/sqlite3-api.js b/ext/fiddle/sqlite3-api.js
index 1be4d9c77..5057eb53f 100644
--- a/ext/fiddle/sqlite3-api.js
+++ b/ext/fiddle/sqlite3-api.js
@@ -222,11 +222,10 @@ Module.postRun.push(function(namespace/*the module object, the target for
["sqlite3_prepare_v2", "number", ["number", "string", "number", "number", "number"]],
["sqlite3_prepare_v2_sqlptr", "sqlite3_prepare_v2",
/* Impl which requires that the 2nd argument be a pointer to
- the SQL, instead of a string. This is used for cases where
- we require a non-NULL value for the final argument. We may
- or may not need this, depending on how our higher-level
- API shapes up, but this code's spiritual guide (sql.js)
- uses it we we'll include it. */
+ the SQL string, instead of being converted to a
+ string. This is used for cases where we require a non-NULL
+ value for the final argument (exec()'ing multiple
+ statements from one input string). */
"number", ["number", "number", "number", "number", "number"]],
["sqlite3_reset", "number", ["number"]],
["sqlite3_result_blob",null,["number", "number", "number", "number"]],
@@ -1518,6 +1517,29 @@ Module.postRun.push(function(namespace/*the module object, the target for
be able to work with multi-hundred-meg (or larger) blobs, and
passing around arrays of those may quickly exhaust the JS
engine's memory.
+
+ TODOs include, but are not limited to:
+
+ - The ability to manage multiple DB handles. This can
+ potentially be done via a simple mapping of DB.filename or
+ DB._pDb (`sqlite3*` handle) to DB objects. The open()
+ interface would need to provide an ID (probably DB._pDb) back
+ to the user which can optionally be passed as an argument to
+ the other APIs (they'd default to the first-opened DB, for
+ ease of use). Client-side usability of this feature would
+ benefit from making another wrapper class (or a singleton)
+ available to the main thread, with that object proxying all(?)
+ communication with the worker.
+
+ - Revisit how virtual files are managed. We currently delete DBs
+ from the virtual filesystem when we close them, for the sake
+ of saving memory (the VFS lives in RAM). Supporting multiple
+ DBs may require that we give up that habit. Similarly, fully
+ supporting ATTACH, where a user can upload multiple DBs and
+ ATTACH them, also requires the that we manage the VFS entries
+ better. As of this writing, ATTACH will fail fatally in the
+ fiddle app (but not the lower-level APIs) because it runs in
+ safe mode, where ATTACH is disabled.
*/
/**