1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Expose a number of infrequently-used sqlite3_...() functions to wasm whose absences were noticed while documenting.

FossilOrigin-Name: 3144e7c0b8633d99daa07d75dabfe6e115ad401110f6f3c85f768e973299f3d9
This commit is contained in:
stephan
2022-12-12 07:27:22 +00:00
parent 56bc31588e
commit 9bda4c53c1
5 changed files with 61 additions and 10 deletions

View File

@ -44,6 +44,7 @@ _sqlite3_db_status
_sqlite3_declare_vtab
_sqlite3_deserialize
_sqlite3_drop_modules
_sqlite3_errcode
_sqlite3_errmsg
_sqlite3_error_offset
_sqlite3_errstr
@ -56,8 +57,13 @@ _sqlite3_finalize
_sqlite3_free
_sqlite3_get_auxdata
_sqlite3_initialize
_sqlite3_keyword_count
_sqlite3_keyword_name
_sqlite3_keyword_check
_sqlite3_last_insert_rowid
_sqlite3_libversion
_sqlite3_libversion_number
_sqlite3_limit
_sqlite3_malloc
_sqlite3_malloc64
_sqlite3_msize
@ -66,6 +72,7 @@ _sqlite3_open_v2
_sqlite3_overload_function
_sqlite3_prepare_v2
_sqlite3_prepare_v3
_sqlite3_progress_handler
_sqlite3_randomness
_sqlite3_realloc
_sqlite3_realloc64
@ -86,12 +93,15 @@ _sqlite3_result_zeroblob
_sqlite3_result_zeroblob64
_sqlite3_serialize
_sqlite3_set_auxdata
_sqlite3_set_last_insert_rowid
_sqlite3_shutdown
_sqlite3_sourceid
_sqlite3_sql
_sqlite3_status
_sqlite3_status64
_sqlite3_step
_sqlite3_stmt_isexplain
_sqlite3_stmt_readonly
_sqlite3_stmt_status
_sqlite3_strglob
_sqlite3_stricmp

View File

@ -957,6 +957,7 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
might use a different allocator than the user for managing the
deserialized block. de/serialize() are ONLY safe to use with
sqlite3_malloc(), sqlite3_free(), and its 64-bit variants. */,
["sqlite3_errcode", "int", "sqlite3*"],
["sqlite3_errmsg", "string", "sqlite3*"],
["sqlite3_error_offset", "int", "sqlite3*"],
["sqlite3_errstr", "string", "int"],
@ -975,8 +976,12 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
^^^ we cannot actually currently support this because JS is
single-threaded and we don't have a portable way to access a DB
from 2 SharedWorkers concurrently. ],*/
["sqlite3_keyword_count", "int"],
["sqlite3_keyword_name", "int", ["int", "**", "*"]],
["sqlite3_keyword_check", "int", ["string", "int"]],
["sqlite3_libversion", "string"],
["sqlite3_libversion_number", "int"],
["sqlite3_limit", "int", ["sqlite3*", "int", "int"]],
["sqlite3_malloc", "*","int"],
["sqlite3_open", "int", "string", "*"],
["sqlite3_open_v2", "int", "string", "*", "int", "string"],
@ -985,6 +990,14 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
for those, depending on how their SQL argument is provided. */
/* sqlite3_randomness() uses a hand-written wrapper to extend
the range of supported argument types. */
//TODO: hand-written wrapper to convert function-type arg:
//void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
//
//!TODO!: accept arg/result conversion descriptions which are objects
//following an interface and a FuncPtr impl which does that conversion.
//That would require moving these bindings int sqlite3-api-glue.js, after
//whwasmutil.js is loaded.
["sqlite3_progress_handler", undefined, ["sqlite3*","int", "*", "*"]],
["sqlite3_realloc", "*","*","int"],
["sqlite3_reset", "int", "sqlite3_stmt*"],
["sqlite3_result_blob", undefined, "sqlite3_context*", "*", "int", "*"],
@ -1007,6 +1020,8 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
["sqlite3_sql", "string", "sqlite3_stmt*"],
["sqlite3_status", "int", "int", "*", "*", "int"],
["sqlite3_step", "int", "sqlite3_stmt*"],
["sqlite3_stmt_isexplain", "int", ["sqlite3_stmt*"]],
["sqlite3_stmt_readonly", "int", ["sqlite3_stmt*"]],
["sqlite3_stmt_status", "int", "sqlite3_stmt*", "int", "int"],
["sqlite3_strglob", "int", "string","string"],
["sqlite3_stricmp", "int", "string", "string"],
@ -1068,12 +1083,14 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
["sqlite3*","string","sqlite3_module*","*","*"]],
["sqlite3_declare_vtab", "int", ["sqlite3*", "string:flexible"]],
["sqlite3_drop_modules", "int", ["sqlite3*", "**"]],
["sqlite3_last_insert_rowid", "i64", ["sqlite3*"]],
["sqlite3_malloc64", "*","i64"],
["sqlite3_msize", "i64", "*"],
["sqlite3_overload_function", "int", ["sqlite3*","string","int"]],
["sqlite3_realloc64", "*","*", "i64"],
["sqlite3_result_int64", undefined, "*", "i64"],
["sqlite3_result_zeroblob64", "int", "*", "i64"],
["sqlite3_set_last_insert_rowid", undefined, ["sqlite3*", "i64"]],
["sqlite3_status64", "int", "int", "*", "*", "int"],
["sqlite3_total_changes64", "i64", ["sqlite3*"]],
["sqlite3_uri_int64", "i64", ["sqlite3_filename", "string", "i64"]],

View File

@ -368,7 +368,7 @@ void sqlite3_wasm_test_struct(WasmTestStruct * s){
*/
SQLITE_WASM_KEEP
const char * sqlite3_wasm_enum_json(void){
static char aBuffer[1024 * 16] = {0} /* where the JSON goes */;
static char aBuffer[1024 * 20] = {0} /* where the JSON goes */;
int n = 0, nChildren = 0, nStruct = 0
/* output counters for figuring out where commas go */;
char * zPos = &aBuffer[1] /* skip first byte for now to help protect
@ -550,6 +550,30 @@ const char * sqlite3_wasm_enum_json(void){
DefGroup(limits) {
DefInt(SQLITE_MAX_ALLOCATION_SIZE);
DefInt(SQLITE_LIMIT_LENGTH);
DefInt(SQLITE_MAX_LENGTH);
DefInt(SQLITE_LIMIT_SQL_LENGTH);
DefInt(SQLITE_MAX_SQL_LENGTH);
DefInt(SQLITE_LIMIT_COLUMN);
DefInt(SQLITE_MAX_COLUMN);
DefInt(SQLITE_LIMIT_EXPR_DEPTH);
DefInt(SQLITE_MAX_EXPR_DEPTH);
DefInt(SQLITE_LIMIT_COMPOUND_SELECT);
DefInt(SQLITE_MAX_COMPOUND_SELECT);
DefInt(SQLITE_LIMIT_VDBE_OP);
DefInt(SQLITE_MAX_VDBE_OP);
DefInt(SQLITE_LIMIT_FUNCTION_ARG);
DefInt(SQLITE_MAX_FUNCTION_ARG);
DefInt(SQLITE_LIMIT_ATTACHED);
DefInt(SQLITE_MAX_ATTACHED);
DefInt(SQLITE_LIMIT_LIKE_PATTERN_LENGTH);
DefInt(SQLITE_MAX_LIKE_PATTERN_LENGTH);
DefInt(SQLITE_LIMIT_VARIABLE_NUMBER);
DefInt(SQLITE_MAX_VARIABLE_NUMBER);
DefInt(SQLITE_LIMIT_TRIGGER_DEPTH);
DefInt(SQLITE_MAX_TRIGGER_DEPTH);
DefInt(SQLITE_LIMIT_WORKER_THREADS);
DefInt(SQLITE_MAX_WORKER_THREADS);
} _DefGroup;
DefGroup(openFlags) {

View File

@ -1,5 +1,5 @@
C Minor\sbuild\stweaks\sin\sext/wasm\sto\screate\sa\sfaster-running\sbuild\sfor\sthe\scommon\sdev-mode\scases.\sNo\scode\schanges.
D 2022-12-11T07:53:03.812
C Expose\sa\snumber\sof\sinfrequently-used\ssqlite3_...()\sfunctions\sto\swasm\swhose\sabsences\swere\snoticed\swhile\sdocumenting.
D 2022-12-12T07:27:22.342
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -494,7 +494,7 @@ F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34ce
F ext/wasm/GNUmakefile 89feb939ec9c3691ab5749d0dab06c7ef2a370191fe1d9e79aad494c3f863b65
F ext/wasm/README-dist.txt 2d670b426fc7c613b90a7d2f2b05b433088fe65181abead970980f0a4a75ea20
F ext/wasm/README.md ef39861aa21632fdbca0bdd469f78f0096f6449a720f3f39642594af503030e9
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api 371830de7e6c5f93c1f44044db2a1ef55998406a7fe6dc25875a97f85cb30032
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api 36ba8ac2bbd1589a6f179c34f1a54f618e0e1eadb8860d049707d3f4fc630a6c
F ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api 1ec3c73e7d66e95529c3c64ac3de2470b0e9e7fbf7a5b41261c367cf4f1b7287
F ext/wasm/api/README.md 17fb1e10335cc87e366dec496c5b17b061f3f75cdf216e825258de34d97a3e53
F ext/wasm/api/extern-post-js.c-pp.js 8923f76c3d2213159e12d641dc750523ead5c848185dc4996fae5cc12397f88d
@ -505,14 +505,14 @@ F ext/wasm/api/pre-js.c-pp.js b88499dc303c21fc3f55f2c364a0f814f587b60a9578430388
F ext/wasm/api/sqlite3-api-cleanup.js 680d5ccfff54459db136a49b2199d9f879c8405d9c99af1dda0cc5e7c29056f4
F ext/wasm/api/sqlite3-api-glue.js fc2b58b3309fa404d3e58499609e5c5b17177687f53f1a6703c50067904d7f72
F ext/wasm/api/sqlite3-api-oo1.js 6d10849609231ccd46fa11b1d3fbbe0f45d9fe84c66a0b054601036540844300
F ext/wasm/api/sqlite3-api-prologue.js 70ba9bfefacbf11727da6a8f404fccbe666353d097112f3ed9b14f38e44c1bba
F ext/wasm/api/sqlite3-api-prologue.js 1ea63e5d6af994dc7f5a7fa8c050a87a6450dd8cb9ee7c9fec3d050ec7daf1eb
F ext/wasm/api/sqlite3-api-worker1.js e94ba98e44afccfa482874cd9acb325883ade50ed1f9f9526beb9de1711f182f
F ext/wasm/api/sqlite3-license-version-header.js a661182fc93fc2cf212dfd0b987f8e138a3ac98f850b1112e29b5fbdaecc87c3
F ext/wasm/api/sqlite3-opfs-async-proxy.js 7795b84b66a7a8dedc791340709b310bb497c3c72a80bef364fa2a58e2ddae3f
F ext/wasm/api/sqlite3-v-helper.js 6f6c3e390a72e08b0a5b16a0d567d7af3c04d172831853a29d72a6f1dd40ff24
F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 66daf6fb6843bea615fe193109e1542efbeca24f560ee9da63375a910bb48115
F ext/wasm/api/sqlite3-wasi.h 25356084cfe0d40458a902afb465df8c21fc4152c1d0a59b563a3fba59a068f9
F ext/wasm/api/sqlite3-wasm.c daad00c6822facb6ceb506dadc2201c734e9128c457c93f9304df01542084216
F ext/wasm/api/sqlite3-wasm.c 8ddad8cbae140d899b2cdd444c92d5ad2358e26162adbe9cf1d30a4ff28dcace
F ext/wasm/api/sqlite3-worker1-promiser.js 0c7a9826dbf82a5ed4e4f7bf7816e825a52aff253afbf3350431f5773faf0e4b
F ext/wasm/api/sqlite3-worker1.js 1e54ea3d540161bcfb2100368a2fc0cad871a207b8336afee1c445715851ec54
F ext/wasm/batch-runner.html 4deeed44fe41496dc6898d9fb17938ea3291f40f4bfb977e29d0cef96fbbe4c8
@ -2067,8 +2067,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 6f0bf892695acaa2f6fd1fccc767340caf5edfdb8b0816bda33d52cc21d5da45
R bc6d65d79471a3c90e90a2054918cffd
P 6a61b14a6cf8279a5b8b77f934c2b97965f5e3fe4cddb03e78c2c0a840dbe6f6
R 7e4fbdabb2c2d4c5af212007b38bdc96
U stephan
Z ebfde1d6b19cd2e44b8ac10487eb0273
Z e3ce8683a07f99ce65843af3f7afa505
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
6a61b14a6cf8279a5b8b77f934c2b97965f5e3fe4cddb03e78c2c0a840dbe6f6
3144e7c0b8633d99daa07d75dabfe6e115ad401110f6f3c85f768e973299f3d9