1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix part 2 of 2 for /fiddle: a make deps problem which caused fiddle to load but fail to run when sqlite3.c was missing.

FossilOrigin-Name: 6011bc26764760af750de68f1553f45382766dd2195633ae267bdb4f9ac75d0f
This commit is contained in:
stephan
2023-08-01 16:38:08 +00:00
parent a08d363f67
commit 887f6e5082
4 changed files with 15 additions and 13 deletions

View File

@ -18,7 +18,7 @@ endif
ifeq (,$(SHELL_SRC))
$(error Could not parse SHELL_SRC from $(dir.top)/Makefile.)
endif
$(dir.top)/shell.c: $(SHELL_SRC) $(dir.top)/tool/mkshellc.tcl
$(dir.top)/shell.c: $(SHELL_SRC) $(dir.top)/tool/mkshellc.tcl $(sqlite3.c)
$(MAKE) -C $(dir.top) shell.c
# /shell.c
########################################################################

View File

@ -221,7 +221,7 @@
f._();
}
};
self.onmessage = function f(ev){
ev = ev.data;
if(!f.cache){
@ -371,12 +371,14 @@
sqlite3InitModule(fiddleModule).then((_sqlite3)=>{
sqlite3 = _sqlite3;
console.warn("Installing sqlite3 module globally (in Worker)",
"for use in the dev console.");
self.sqlite3 = sqlite3;
"for use in the dev console.", sqlite3);
globalThis.sqlite3 = sqlite3;
const dbVfs = sqlite3.wasm.xWrap('fiddle_db_vfs', "*", ['string']);
fiddleModule.fsUnlink = (fn)=>{
return sqlite3.wasm.sqlite3_wasm_vfs_unlink(dbVfs(0), fn);
};
wMsg('fiddle-ready');
})/*then()*/;
}).catch(e=>{
console.error("Fiddle worker init failed:",e);
});
})();