Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Restructuring of the wasm build to support an experimental 'minimal' build mode which elides all non-core APIs. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
ee2191f7302210100fa0b29ace815653 |
User & Date: | stephan 2024-07-24 22:07:18 |
Context
2024-07-24
| ||
23:58 | wasm minimal build: strip authorizers and JSON support (saves approx 35kb). Strip vtab support from the JS bits but cannot yet strip it from the C bits because that requires a custom-configured sqlite3.c. (check-in: eb64d106 user: stephan tags: trunk) | |
22:07 | Restructuring of the wasm build to support an experimental 'minimal' build mode which elides all non-core APIs. (check-in: ee2191f7 user: stephan tags: trunk) | |
13:53 | Add the percentile extension to the CLI by default. (check-in: bcc31846 user: drh tags: trunk) | |
Changes
Changes to ext/wasm/GNUmakefile.
︙ | ︙ | |||
228 229 230 231 232 233 234 235 236 237 238 239 240 241 | -DSQLITE_C=$(sqlite3.c) #SQLITE_OPT += -DSQLITE_DEBUG # Enabling SQLITE_DEBUG will break sqlite3_wasm_vfs_create_file() # (and thus sqlite3_js_vfs_create_file()). Those functions are # deprecated and alternatives are in place, but this crash behavior # can be used to find errant uses of sqlite3_js_vfs_create_file() # in client code. ########################################################################@ # It's important that sqlite3.h be built to completion before any # other parts of the build run, thus we use .NOTPARALLEL to disable # parallel build of that file and its dependants. .NOTPARALLEL: $(sqlite3.h) $(sqlite3.h): | > > > > > > > > | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | -DSQLITE_C=$(sqlite3.c) #SQLITE_OPT += -DSQLITE_DEBUG # Enabling SQLITE_DEBUG will break sqlite3_wasm_vfs_create_file() # (and thus sqlite3_js_vfs_create_file()). Those functions are # deprecated and alternatives are in place, but this crash behavior # can be used to find errant uses of sqlite3_js_vfs_create_file() # in client code. ######################################################################## # minimal=1 disables all "extraneous" stuff from sqlite3-wasm.c, the # goal being to create a WASM file with only the core APIs. minimal ?= 0 ifeq (1,$(minimal)) SQLITE_OPT += -DSQLITE_WASM_MINIMAL endif ########################################################################@ # It's important that sqlite3.h be built to completion before any # other parts of the build run, thus we use .NOTPARALLEL to disable # parallel build of that file and its dependants. .NOTPARALLEL: $(sqlite3.h) $(sqlite3.h): |
︙ | ︙ | |||
409 410 411 412 413 414 415 | # runtime speeds, but not by a large enough factor to rule out use of # -Oz when small deliverable size is a priority. ######################################################################## ######################################################################## # EXPORTED_FUNCTIONS.* = files for use with Emscripten's # -sEXPORTED_FUNCTION flag. | | | > > > > > > > > > | 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | # runtime speeds, but not by a large enough factor to rule out use of # -Oz when small deliverable size is a priority. ######################################################################## ######################################################################## # EXPORTED_FUNCTIONS.* = files for use with Emscripten's # -sEXPORTED_FUNCTION flag. EXPORTED_FUNCTIONS.api.core := $(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-core) EXPORTED_FUNCTIONS.api.in := $(EXPORTED_FUNCTIONS.api.core) ifeq (1,$(SQLITE_C_IS_SEE)) EXPORTED_FUNCTIONS.api.in += $(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-see) endif ifeq (0,$(minimal)) EXPORTED_FUNCTIONS.api.in += \ $(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-session) \ $(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-preupdate) else $(info ========================================) $(info This is a minimal-mode build) $(info ========================================) endif EXPORTED_FUNCTIONS.api := $(dir.tmp)/EXPORTED_FUNCTIONS.api $(EXPORTED_FUNCTIONS.api): $(EXPORTED_FUNCTIONS.api.in) $(sqlite3.c) $(MAKEFILE) cat $(EXPORTED_FUNCTIONS.api.in) > $@ ######################################################################## # sqlite3-license-version.js = generated JS file with the license # header and version info. |
︙ | ︙ | |||
1055 1056 1057 1058 1059 1060 1061 | # when you printf etc. # # and pending output is not flushed because it didn't end with a # newline (by design). The lesser of the two evils seems to be # -sEXIT_RUNTIME=1 but we need EXIT_RUNTIME=0 for the worker-based app # which runs speedtest1 multiple times. | | | > | 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 | # when you printf etc. # # and pending output is not flushed because it didn't end with a # newline (by design). The lesser of the two evils seems to be # -sEXIT_RUNTIME=1 but we need EXIT_RUNTIME=0 for the worker-based app # which runs speedtest1 multiple times. $(EXPORTED_FUNCTIONS.speedtest1): $(EXPORTED_FUNCTIONS.api.core) @echo "Making $@ ..." @{ echo _wasm_main; cat $(EXPORTED_FUNCTIONS.api.core); } > $@ speedtest1.js := $(dir.dout)/speedtest1.js speedtest1.wasm := $(dir.dout)/speedtest1.wasm emcc.flags.speedtest1-vanilla := $(cflags.common) -DSQLITE_SPEEDTEST1_WASM speedtest1.cfiles := $(speedtest1.c) $(sqlite3-wasm.c) $(eval $(call call-make-pre-post,speedtest1,vanilla)) $(speedtest1.js): $(MAKEFILE) $(speedtest1.cfiles) \ $(pre-post-speedtest1-vanilla.deps) \ $(EXPORTED_FUNCTIONS.speedtest1) @echo "Building $@ ..." $(emcc.bin) \ $(emcc.speedtest1) \ $(emcc.speedtest1.common) \ $(emcc.flags.speedtest1-vanilla) $(pre-post-speedtest1-vanilla.flags) \ $(SQLITE_OPT) \ -USQLITE_WASM_MINIMAL \ -USQLITE_C -DSQLITE_C=$(sqlite3.canonical.c) \ $(speedtest1.exit-runtime0) \ -o $@ $(speedtest1.cfiles) -lm $(maybe-wasm-strip) $(speedtest1.wasm) chmod -x $(speedtest1.wasm) ls -la $@ $(speedtest1.wasm) |
︙ | ︙ |
Name change from ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api to ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-core.
︙ | ︙ | |||
80 81 82 83 84 85 86 | _sqlite3_malloc64 _sqlite3_msize _sqlite3_open _sqlite3_open_v2 _sqlite3_overload_function _sqlite3_prepare_v2 _sqlite3_prepare_v3 | < < < < < < | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | _sqlite3_malloc64 _sqlite3_msize _sqlite3_open _sqlite3_open_v2 _sqlite3_overload_function _sqlite3_prepare_v2 _sqlite3_prepare_v3 _sqlite3_progress_handler _sqlite3_randomness _sqlite3_realloc _sqlite3_realloc64 _sqlite3_reset _sqlite3_reset_auto_extension _sqlite3_result_blob |
︙ | ︙ | |||
162 163 164 165 166 167 168 | _sqlite3_vtab_distinct _sqlite3_vtab_in _sqlite3_vtab_in_first _sqlite3_vtab_in_next _sqlite3_vtab_nochange _sqlite3_vtab_on_conflict _sqlite3_vtab_rhs_value | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 156 157 158 159 160 161 162 | _sqlite3_vtab_distinct _sqlite3_vtab_in _sqlite3_vtab_in_first _sqlite3_vtab_in_next _sqlite3_vtab_nochange _sqlite3_vtab_on_conflict _sqlite3_vtab_rhs_value |
Added ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-preupdate.
> > > > > > | 1 2 3 4 5 6 | _sqlite3_preupdate_blobwrite _sqlite3_preupdate_count _sqlite3_preupdate_depth _sqlite3_preupdate_hook _sqlite3_preupdate_new _sqlite3_preupdate_old |
Added ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-session.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | _sqlite3changegroup_add _sqlite3changegroup_add_strm _sqlite3changegroup_delete _sqlite3changegroup_new _sqlite3changegroup_output _sqlite3changegroup_output_strm _sqlite3changeset_apply _sqlite3changeset_apply_strm _sqlite3changeset_apply_v2 _sqlite3changeset_apply_v2_strm _sqlite3changeset_concat _sqlite3changeset_concat_strm _sqlite3changeset_conflict _sqlite3changeset_finalize _sqlite3changeset_fk_conflicts _sqlite3changeset_invert _sqlite3changeset_invert_strm _sqlite3changeset_new _sqlite3changeset_next _sqlite3changeset_old _sqlite3changeset_op _sqlite3changeset_pk _sqlite3changeset_start _sqlite3changeset_start_strm _sqlite3changeset_start_v2 _sqlite3changeset_start_v2_strm _sqlite3session_attach _sqlite3session_changeset _sqlite3session_changeset_size _sqlite3session_changeset_strm _sqlite3session_config _sqlite3session_create _sqlite3session_delete _sqlite3session_diff _sqlite3session_enable _sqlite3session_indirect _sqlite3session_isempty _sqlite3session_memory_used _sqlite3session_object_config _sqlite3session_patchset _sqlite3session_patchset_strm _sqlite3session_table_filter |
Changes to ext/wasm/api/sqlite3-api-glue.c-pp.js.
︙ | ︙ | |||
381 382 383 384 385 386 387 | sqlite3.wasm.alloc() and friends use those allocators. Custom builds may not guarantee that, however. */, ["sqlite3_drop_modules", "int", ["sqlite3*", "**"]], ["sqlite3_last_insert_rowid", "i64", ["sqlite3*"]], ["sqlite3_malloc64", "*","i64"], ["sqlite3_msize", "i64", "*"], ["sqlite3_overload_function", "int", ["sqlite3*","string","int"]], | < < < < < < < < < < < < < < < < < < < < | 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | sqlite3.wasm.alloc() and friends use those allocators. Custom builds may not guarantee that, however. */, ["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_serialize","*", "sqlite3*", "string", "*", "int"], ["sqlite3_set_last_insert_rowid", undefined, ["sqlite3*", "i64"]], ["sqlite3_status64", "int", "int", "*", "*", "int"], ["sqlite3_total_changes64", "i64", ["sqlite3*"]], |
︙ | ︙ | |||
435 436 437 438 439 440 441 442 443 | ["sqlite3_vtab_in_next", "int", "sqlite3_value*", "**"], /*["sqlite3_vtab_config" is variadic and requires a hand-written proxy.] */ ["sqlite3_vtab_nochange","int", "sqlite3_context*"], ["sqlite3_vtab_on_conflict","int", "sqlite3*"], ["sqlite3_vtab_rhs_value","int", "sqlite3_index_info*", "int", "**"] ]; // Add session/changeset APIs... | > > > > > > > > > > > > > > > > > > > > > > > > > > | > > | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | ["sqlite3_vtab_in_next", "int", "sqlite3_value*", "**"], /*["sqlite3_vtab_config" is variadic and requires a hand-written proxy.] */ ["sqlite3_vtab_nochange","int", "sqlite3_context*"], ["sqlite3_vtab_on_conflict","int", "sqlite3*"], ["sqlite3_vtab_rhs_value","int", "sqlite3_index_info*", "int", "**"] ]; if(wasm.bigIntEnabled && !!wasm.exports.sqlite3_preupdate_hook){ wasm.bindingSignatures.int64.push( ["sqlite3_preupdate_blobwrite", "int", "sqlite3*"], ["sqlite3_preupdate_count", "int", "sqlite3*"], ["sqlite3_preupdate_depth", "int", "sqlite3*"], ["sqlite3_preupdate_hook", "*", [ "sqlite3*", new wasm.xWrap.FuncPtrAdapter({ name: 'sqlite3_preupdate_hook', signature: "v(ppippjj)", contextKey: (argv)=>argv[0/* sqlite3* */], callProxy: (callback)=>{ return (p,db,op,zDb,zTbl,iKey1,iKey2)=>{ callback(p, db, op, wasm.cstrToJs(zDb), wasm.cstrToJs(zTbl), iKey1, iKey2); }; } }), "*" ]], ["sqlite3_preupdate_new", "int", ["sqlite3*", "int", "**"]], ["sqlite3_preupdate_old", "int", ["sqlite3*", "int", "**"]] ); } /* preupdate API */ // Add session/changeset APIs... if(wasm.bigIntEnabled && !!wasm.exports.sqlite3changegroup_add && !!wasm.exports.sqlite3session_create && !!wasm.exports.sqlite3_preupdate_hook /* required by the session API */){ /** FuncPtrAdapter options for session-related callbacks with the native signature "i(ps)". This proxy converts the 2nd argument from a C string to a JS string before passing the arguments on to the client-provided JS callback. */ const __ipsProxy = { |
︙ | ︙ | |||
1075 1076 1077 1078 1079 1080 1081 | if(pDb){ try{__dbCleanupMap.cleanup(pDb)} catch(e){/*ignored*/} } return __sqlite3CloseV2(pDb); }; }/*sqlite3_close_v2()*/ | | | 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 | if(pDb){ try{__dbCleanupMap.cleanup(pDb)} catch(e){/*ignored*/} } return __sqlite3CloseV2(pDb); }; }/*sqlite3_close_v2()*/ if(capi.sqlite3session_create){ const __sqlite3SessionDelete = wasm.xWrap( 'sqlite3session_delete', undefined, ['sqlite3_session*'] ); capi.sqlite3session_delete = function(pSession){ if(1!==arguments.length){ return __dbArgcMismatch(pDb, 'sqlite3session_delete', 1); /* Yes, we're returning a value from a void function. That seems |
︙ | ︙ |
Changes to ext/wasm/api/sqlite3-wasm.c.
︙ | ︙ | |||
100 101 102 103 104 105 106 | #endif #ifndef SQLITE_ENABLE_DBSTAT_VTAB # define SQLITE_ENABLE_DBSTAT_VTAB 1 #endif #ifndef SQLITE_ENABLE_EXPLAIN_COMMENTS # define SQLITE_ENABLE_EXPLAIN_COMMENTS 1 #endif | | | | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | #endif #ifndef SQLITE_ENABLE_DBSTAT_VTAB # define SQLITE_ENABLE_DBSTAT_VTAB 1 #endif #ifndef SQLITE_ENABLE_EXPLAIN_COMMENTS # define SQLITE_ENABLE_EXPLAIN_COMMENTS 1 #endif #ifndef SQLITE_ENABLE_FTS5 # define SQLITE_ENABLE_FTS5 1 #endif #ifndef SQLITE_ENABLE_MATH_FUNCTIONS # define SQLITE_ENABLE_MATH_FUNCTIONS 1 #endif #ifndef SQLITE_ENABLE_OFFSET_SQL_FUNC # define SQLITE_ENABLE_OFFSET_SQL_FUNC 1 #endif |
︙ | ︙ | |||
125 126 127 128 129 130 131 132 133 134 135 136 137 138 | #ifndef SQLITE_ENABLE_STMTVTAB # define SQLITE_ENABLE_STMTVTAB 1 #endif #ifndef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION # define SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION #endif /**********************************************************************/ /* SQLITE_O... */ #ifndef SQLITE_OMIT_DEPRECATED # define SQLITE_OMIT_DEPRECATED 1 #endif #ifndef SQLITE_OMIT_LOAD_EXTENSION # define SQLITE_OMIT_LOAD_EXTENSION 1 | > > > > > > > > > > > > > > > > | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | #ifndef SQLITE_ENABLE_STMTVTAB # define SQLITE_ENABLE_STMTVTAB 1 #endif #ifndef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION # define SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION #endif /* ** If SQLITE_WASM_MINIMAL is defined, undefine most of the ENABLE ** macros. */ #ifdef SQLITE_WASM_MINIMAL # undef SQLITE_ENABLE_DBPAGE_VTAB # undef SQLITE_ENABLE_DBSTAT_VTAB # undef SQLITE_ENABLE_EXPLAIN_COMMENTS # undef SQLITE_ENABLE_FTS5 # undef SQLITE_ENABLE_OFFSET_SQL_FUNC # undef SQLITE_ENABLE_PREUPDATE_HOOK # undef SQLITE_ENABLE_RTREE # undef SQLITE_ENABLE_SESSION # undef SQLITE_ENABLE_STMTVTAB #endif /**********************************************************************/ /* SQLITE_O... */ #ifndef SQLITE_OMIT_DEPRECATED # define SQLITE_OMIT_DEPRECATED 1 #endif #ifndef SQLITE_OMIT_LOAD_EXTENSION # define SQLITE_OMIT_LOAD_EXTENSION 1 |
︙ | ︙ | |||
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | ** integers to avoid casting-related warnings. */ out("\"SQLITE_STATIC\":0, \"SQLITE_TRANSIENT\":-1"); outf(",\"SQLITE_WASM_DEALLOC\": %lld", (sqlite3_int64)(sqlite3_free)); } _DefGroup; DefGroup(changeset){ DefInt(SQLITE_CHANGESETSTART_INVERT); DefInt(SQLITE_CHANGESETAPPLY_NOSAVEPOINT); DefInt(SQLITE_CHANGESETAPPLY_INVERT); DefInt(SQLITE_CHANGESETAPPLY_IGNORENOOP); DefInt(SQLITE_CHANGESET_DATA); DefInt(SQLITE_CHANGESET_NOTFOUND); DefInt(SQLITE_CHANGESET_CONFLICT); DefInt(SQLITE_CHANGESET_CONSTRAINT); DefInt(SQLITE_CHANGESET_FOREIGN_KEY); DefInt(SQLITE_CHANGESET_OMIT); DefInt(SQLITE_CHANGESET_REPLACE); DefInt(SQLITE_CHANGESET_ABORT); } _DefGroup; DefGroup(config){ DefInt(SQLITE_CONFIG_SINGLETHREAD); DefInt(SQLITE_CONFIG_MULTITHREAD); DefInt(SQLITE_CONFIG_SERIALIZED); DefInt(SQLITE_CONFIG_MALLOC); | > > | 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 | ** integers to avoid casting-related warnings. */ out("\"SQLITE_STATIC\":0, \"SQLITE_TRANSIENT\":-1"); outf(",\"SQLITE_WASM_DEALLOC\": %lld", (sqlite3_int64)(sqlite3_free)); } _DefGroup; DefGroup(changeset){ #ifdef SQLITE_CHANGESETSTART_INVERT DefInt(SQLITE_CHANGESETSTART_INVERT); DefInt(SQLITE_CHANGESETAPPLY_NOSAVEPOINT); DefInt(SQLITE_CHANGESETAPPLY_INVERT); DefInt(SQLITE_CHANGESETAPPLY_IGNORENOOP); DefInt(SQLITE_CHANGESET_DATA); DefInt(SQLITE_CHANGESET_NOTFOUND); DefInt(SQLITE_CHANGESET_CONFLICT); DefInt(SQLITE_CHANGESET_CONSTRAINT); DefInt(SQLITE_CHANGESET_FOREIGN_KEY); DefInt(SQLITE_CHANGESET_OMIT); DefInt(SQLITE_CHANGESET_REPLACE); DefInt(SQLITE_CHANGESET_ABORT); #endif } _DefGroup; DefGroup(config){ DefInt(SQLITE_CONFIG_SINGLETHREAD); DefInt(SQLITE_CONFIG_MULTITHREAD); DefInt(SQLITE_CONFIG_SERIALIZED); DefInt(SQLITE_CONFIG_MALLOC); |
︙ | ︙ | |||
560 561 562 563 564 565 566 | } _DefGroup; DefGroup(dbConfig){ DefInt(SQLITE_DBCONFIG_MAINDBNAME); DefInt(SQLITE_DBCONFIG_LOOKASIDE); DefInt(SQLITE_DBCONFIG_ENABLE_FKEY); DefInt(SQLITE_DBCONFIG_ENABLE_TRIGGER); | < | 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | } _DefGroup; DefGroup(dbConfig){ DefInt(SQLITE_DBCONFIG_MAINDBNAME); DefInt(SQLITE_DBCONFIG_LOOKASIDE); DefInt(SQLITE_DBCONFIG_ENABLE_FKEY); DefInt(SQLITE_DBCONFIG_ENABLE_TRIGGER); DefInt(SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION); DefInt(SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE); DefInt(SQLITE_DBCONFIG_ENABLE_QPSG); DefInt(SQLITE_DBCONFIG_TRIGGER_EQP); DefInt(SQLITE_DBCONFIG_RESET_DATABASE); DefInt(SQLITE_DBCONFIG_DEFENSIVE); DefInt(SQLITE_DBCONFIG_WRITABLE_SCHEMA); |
︙ | ︙ | |||
855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 | DefInt(SQLITE_SERIALIZE_NOCOPY); DefInt(SQLITE_DESERIALIZE_FREEONCLOSE); DefInt(SQLITE_DESERIALIZE_READONLY); DefInt(SQLITE_DESERIALIZE_RESIZEABLE); } _DefGroup; DefGroup(session){ DefInt(SQLITE_SESSION_CONFIG_STRMSIZE); DefInt(SQLITE_SESSION_OBJCONFIG_SIZE); } _DefGroup; DefGroup(sqlite3Status){ DefInt(SQLITE_STATUS_MEMORY_USED); DefInt(SQLITE_STATUS_PAGECACHE_USED); DefInt(SQLITE_STATUS_PAGECACHE_OVERFLOW); //DefInt(SQLITE_STATUS_SCRATCH_USED) /* NOT USED */; | > > | 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 | DefInt(SQLITE_SERIALIZE_NOCOPY); DefInt(SQLITE_DESERIALIZE_FREEONCLOSE); DefInt(SQLITE_DESERIALIZE_READONLY); DefInt(SQLITE_DESERIALIZE_RESIZEABLE); } _DefGroup; DefGroup(session){ #ifdef SQLITE_SESSION_CONFIG_STRMSIZE DefInt(SQLITE_SESSION_CONFIG_STRMSIZE); DefInt(SQLITE_SESSION_OBJCONFIG_SIZE); #endif } _DefGroup; DefGroup(sqlite3Status){ DefInt(SQLITE_STATUS_MEMORY_USED); DefInt(SQLITE_STATUS_PAGECACHE_USED); DefInt(SQLITE_STATUS_PAGECACHE_OVERFLOW); //DefInt(SQLITE_STATUS_SCRATCH_USED) /* NOT USED */; |
︙ | ︙ |
Changes to ext/wasm/fiddle.make.
︙ | ︙ | |||
38 39 40 41 42 43 44 45 46 47 48 49 50 51 | -sWASM_BIGINT=$(emcc.WASM_BIGINT) \ -sEXPORT_NAME=$(sqlite3.js.init-func) \ -Wno-limited-postlink-optimizations \ $(emcc.exportedRuntimeMethods) \ -sEXPORTED_FUNCTIONS=@$(abspath $(EXPORTED_FUNCTIONS.fiddle)) \ -sEXPORTED_RUNTIME_METHODS=FS,wasmMemory \ $(SQLITE_OPT) $(SHELL_OPT) \ -DSQLITE_SHELL_FIDDLE # -D_POSIX_C_SOURCE is needed for strdup() with emcc # Flags specifically for debug builds of fiddle. Performance suffers # greatly in debug builds. fiddle.emcc-flags.debug := $(fiddle.emcc-flags) \ -DSQLITE_DEBUG \ | > | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | -sWASM_BIGINT=$(emcc.WASM_BIGINT) \ -sEXPORT_NAME=$(sqlite3.js.init-func) \ -Wno-limited-postlink-optimizations \ $(emcc.exportedRuntimeMethods) \ -sEXPORTED_FUNCTIONS=@$(abspath $(EXPORTED_FUNCTIONS.fiddle)) \ -sEXPORTED_RUNTIME_METHODS=FS,wasmMemory \ $(SQLITE_OPT) $(SHELL_OPT) \ -USQLITE_WASM_MINIMAL \ -DSQLITE_SHELL_FIDDLE # -D_POSIX_C_SOURCE is needed for strdup() with emcc # Flags specifically for debug builds of fiddle. Performance suffers # greatly in debug builds. fiddle.emcc-flags.debug := $(fiddle.emcc-flags) \ -DSQLITE_DEBUG \ |
︙ | ︙ |
Changes to ext/wasm/tester1.c-pp.js.
︙ | ︙ | |||
2757 2758 2759 2760 2761 2762 2763 | T.assert(3 === capi.sqlite3_update_hook(db, 0, 0)); //wasm.xWrap.FuncPtrAdapter.debugFuncInstall = false; db.close(); } })/* commit/rollback/update hooks */ .t({ name: "sqlite3_preupdate_hook()", | | | 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 | T.assert(3 === capi.sqlite3_update_hook(db, 0, 0)); //wasm.xWrap.FuncPtrAdapter.debugFuncInstall = false; db.close(); } })/* commit/rollback/update hooks */ .t({ name: "sqlite3_preupdate_hook()", predicate: ()=>capi.sqlite3_preupdate_hook || "Missing pre-update hook API", test: function(sqlite3){ const db = new sqlite3.oo1.DB(':memory:', 1 ? 'c' : 'ct'); const countHook = Object.create(null); let rc = capi.sqlite3_preupdate_hook( db, function(p, pDb, op, zDb, zTbl, iKey1, iKey2){ T.assert(9 === p) .assert(db.pointer === pDb) |
︙ | ︙ | |||
2828 2829 2830 2831 2832 2833 2834 | } }); //////////////////////////////////////////////////////////////////////// T.g('Session API') .t({ name: 'Session API sanity checks', | | | 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 | } }); //////////////////////////////////////////////////////////////////////// T.g('Session API') .t({ name: 'Session API sanity checks', predicate: ()=>!!capi.sqlite3changegroup_add || "Missing session API", test: function(sqlite3){ //warn("The session API tests could use some expansion."); const db1 = new sqlite3.oo1.DB(), db2 = new sqlite3.oo1.DB(); const sqlInit = [ "create table t(rowid INTEGER PRIMARY KEY,a,b); ", "insert into t(rowid,a,b) values", "(1,'a1','b1'),", |
︙ | ︙ | |||
3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 | db.close(); }) //////////////////////////////////////////////////////////////////////// T.g('Bug Reports') .t({ name: 'Delete via bound parameter in subquery', test: function(sqlite3){ // Testing https://sqlite.org/forum/forumpost/40ce55bdf5 // with the exception that that post uses "external content" // for the FTS index. const db = new sqlite3.oo1.DB();//(':memory:','wt'); db.exec([ "create virtual table f using fts5 (path);", | > > > > > > > > > > > | 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 | db.close(); }) //////////////////////////////////////////////////////////////////////// T.g('Bug Reports') .t({ name: 'Delete via bound parameter in subquery', predicate: function(sqlite3){ const d = new sqlite3.oo1.DB(); try{ d.exec("create virtual table f using fts5(x)"); return true; }catch(e){ return "FTS5 is not available"; }finally{ d.close(); } }, test: function(sqlite3){ // Testing https://sqlite.org/forum/forumpost/40ce55bdf5 // with the exception that that post uses "external content" // for the FTS index. const db = new sqlite3.oo1.DB();//(':memory:','wt'); db.exec([ "create virtual table f using fts5 (path);", |
︙ | ︙ |