4 The author disclaims copyright to this source code. In place of a
5 legal notice, here is a blessing:
7 * May you do good and not evil.
8 * May you find forgiveness for yourself and forgive others.
9 * May you share freely, never taking more than you give.
11 ***********************************************************************
13 This file is the tail end of the sqlite3-api.js constellation,
14 intended to be appended after all other sqlite3-api-*.js files so
15 that it can finalize any setup and clean up any global symbols
16 temporarily used for setting up the API's various subsystems.
19 if('undefined' !== typeof Module
){ // presumably an Emscripten build
21 Install a suitable default configuration for sqlite3ApiBootstrap().
23 const SABC
= Object
.assign(
24 Object
.create(null), {
25 exports
: Module
['asm'],
26 memory
: Module
.wasmMemory
/* gets set if built with -sIMPORT_MEMORY */
28 self
.sqlite3ApiConfig
|| {}
32 For current (2022-08-22) purposes, automatically call
33 sqlite3ApiBootstrap(). That decision will be revisited at some
34 point, as we really want client code to be able to call this to
35 configure certain parts. Clients may modify
36 self.sqlite3ApiBootstrap.defaultConfig to tweak the default
37 configuration used by a no-args call to sqlite3ApiBootstrap(),
38 but must have first loaded their WASM module in order to be
39 able to provide the necessary configuration state.
41 //console.warn("self.sqlite3ApiConfig = ",self.sqlite3ApiConfig);
42 self
.sqlite3ApiConfig
= SABC
;
45 sqlite3
= self
.sqlite3ApiBootstrap();
47 console
.error("sqlite3ApiBootstrap() error:",e
);
50 delete self
.sqlite3ApiBootstrap
;
51 delete self
.sqlite3ApiConfig
;
54 Module
.sqlite3
= sqlite3
/* Needed for customized sqlite3InitModule() to be able to
55 pass the sqlite3 object off to the client. */;
57 console
.warn("This is not running in an Emscripten module context, so",
58 "self.sqlite3ApiBootstrap() is _not_ being called due to lack",
59 "of config info for the WASM environment.",
60 "It must be called manually.");