1<!doctype html>
2<html lang="en-us">
3  <head>
4    <meta charset="utf-8">
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
7    <script src="jswasm/sqlite3.js"></script>
8    <title>sqlite3 Module Symbols</title>
9  </head>
10  <body>
11<div class="fossil-doc" data-title="sqlite3 Module Symbols">
12  <style>
13    .pseudolist {
14        column-count: auto;
15        column-width: 20rem;
16        column-gap: 1.5em;
17        width: 95%;
18        margin: auto;
19    }
20    .pseudolist > span {
21        font-family: monospace;
22        margin: 0.25em 0;
23        display: block;
24    }
25    .pseudolist.wrap-anywhere {
26        overflow-wrap: anywhere;
27    }
28    .warning { color: firebrick }
29    .error { color: firebrick; background-color: yellow}
30    .hidden, .initially-hidden {
31        position: absolute !important;
32        opacity: 0 !important;
33        pointer-events: none !important;
34        display: none !important;
35    }
36    h1::before, h2::before, h3::before, h4::before {
37        /* Remove automatic numbering */
38        content: "" !important;
39        background-color: transparent !important;
40        margin: 0 !important;
41        border: 0 !important;
42        padding: 0 !important;
43    }
44    .func-wasm {
45
46    }
47    .func-wasm::after {
48        content: "*";
49        color: blue;
50    }
51  </style>
52  <p id='module-load-status'><strong>Loading WASM module...</strong>
53    If this takes "a long time" it may have failed and the browser's
54    dev console may contain hints as to why.
55  </p>
56
57  <p>
58    This page lists the SQLite3 APIs exported
59    by <code>sqlite3.wasm</code> and exposed to clients
60    by <code>sqlite3.js</code>. These lists are generated dynamically
61    by loading the JS/WASM module and introspecting it, with the following
62    caveats:
63  </p>
64
65  <ul>
66    <li>Some APIs are explicitly filtered out of these lists because
67      they are strictly for internal use within the JS/WASM APIs and
68      its own test code.
69    </li>
70    <li>This page runs in the main UI thread so cannot see features
71      which are only available in a Worker thread. If this page were
72      to function via a Worker, it would not be able to see
73      functionality only available in the main thread. Starting a
74      Worker here to fetch those symbols requires loading a second
75      copy of the sqlite3 WASM module and JS code.
76    </li>
77  </ul>
78
79  <div class='initially-hidden'>
80
81    <p>This page exposes a global symbol named <code>sqlite3</code>
82      which can be inspected using the browser's dev tools.
83    </p>
84
85    <p>Jump to...</p>
86    <ul>
87      <li><a href='#sqlite3-namespace'><code>sqlite3</code> namespace</a></li>
88      <li><a href='#sqlite3-version'><code>sqlite3.version</code></a></li>
89      <li><a href='#sqlite3-functions'><code>sqlite3_...()</code> functions</a></li>
90      <li><a href='#sqlite3-constants'><code>SQLITE_...</code> functions</a></li>
91      <li><a href='#sqlite3.oo1'><code>sqlite3.oo1</code></a>
92        <!--ul>
93          <li><a href='#sqlite3.oo1.DB'><code>sqlite3.oo1.DB</code></a></li>
94          <li><a href='#sqlite3.oo1.Stmt'><code>sqlite3.oo1.Stmt</code></a></li>
95        </ul-->
96      </li>
97      <li><a href='#sqlite3.capi.wasm'><code>sqlite3.capi.wasm</code></a></li>
98      <li><a href='#sqlite3.capi.wasm.pstack'><code>sqlite3.capi.wasm.pstack</code></a></li>
99      <li><a href='#compile-options'>Compilation options used in this module build.</a></li>
100    </ul>
101
102    <a id="sqlite3-namespace"></a>
103    <h1><code>sqlite3</code> Namespace</h1>
104    <p>
105      The <code>sqlite3</code> namespace object exposes the following...
106    </p>
107    <div id='list-namespace' class='pseudolist'></div>
108
109    <a id="sqlite3-version"></a>
110    <h1><code>sqlite3.version</code></h1>
111    <p>
112      The <code>sqlite3.version</code> object exposes the following...
113    </p>
114    <div id='list-version' class='pseudolist wrap-anywhere'></div>
115
116    <a id="sqlite3-functions"></a>
117    <h1><code>sqlite3_...()</code> Function List</h1>
118
119    <p>The <code>sqlite3.capi</code> object exposes the following
120      <a href='https://sqlite.org/c3ref/funclist.html'><code>sqlite3_...()</code>
121        functions</a>...
122    </p>
123    <div id='list-functions' class='pseudolist'></div>
124    <p>
125      <code class='func-wasm'></code> = function is specific to the JS/WASM
126      bindings, not part of the C API.
127    </p>
128
129    <a id="sqlite3-constants"></a>
130    <h1><code>SQLITE_...</code> Constants</h1>
131
132    <p>The <code>sqlite3.capi</code> object exposes the following
133      <a href='https://sqlite.org/c3ref/constlist.html'><code>SQLITE_...</code>
134        constants</a>...
135    </p>
136    <div id='list-constants' class='pseudolist'></div>
137
138    <a id="sqlite3.oo1"></a>
139    <h1><code>sqlite3.oo1</code></h1>
140    <p>
141      The <code>sqlite3.oo1</code> object exposes the following...
142    </p>
143    <div id='list-oo1' class='pseudolist'></div>
144
145    <a id="sqlite3.capi.wasm"></a>
146    <h1><code>sqlite3.capi.wasm</code></h1>
147    <p>
148      The <code>sqlite3.capi.wasm</code> object exposes the
149      following...
150    </p>
151    <div id='list-wasm' class='pseudolist'></div>
152
153    <a id="sqlite3.capi.wasm.pstack"></a>
154    <h1><code>sqlite3.capi.wasm.pstack</code></h1>
155    <p>
156      The <code>sqlite3.capi.wasm.pstack</code> object exposes the
157      following...
158    </p>
159    <div id='list-wasm-pstack' class='pseudolist'></div>
160
161    <a id="compile-options"></a>
162    <h1>Compilation Options</h1>
163    <p>
164      Compilation options used in this build of <code>sqlite3.wasm</code>...
165    </p>
166    <div id='list-compile-options' class='pseudolist'></div>
167
168  </div><!-- .initially-hidden -->
169  <script>(async function(){
170    const eNew = (tag,parent)=>{
171        const e = document.createElement(tag);
172        if(parent) parent.appendChild(e);
173        return e;
174    };
175    const eLi = (label,parent)=>{
176        const e = eNew('span',parent);
177        e.innerText = label;
178        return e;
179    };
180    const E = (sel)=>document.querySelector(sel);
181    const EAll = (sel)=>document.querySelectorAll(sel);
182    const eFuncs = E('#list-functions'),
183          eConst = E('#list-constants');
184    const renderConst = function(name){
185        eLi(name, eConst);
186    };
187    const renderFunc = function(name){
188        let lbl = name+'()';
189        const e = eLi(lbl, eFuncs);;
190        if(name.startsWith('sqlite3_js')
191           || name.startsWith('sqlite3_wasm')){
192            e.classList.add('func-wasm');
193        }
194    };
195    const renderGeneric = function(name,value,eParent){
196        let lbl;
197        if(value instanceof Function) lbl = name+'()';
198        else{
199            switch(typeof value){
200                case 'number': case 'boolean': case 'string':
201                    lbl = name+' = '+JSON.stringify(value);
202                    break;
203                default:
204                    lbl = name + ' ['+(typeof value)+']';
205            }
206        }
207        const e = eLi(lbl, eParent);
208        if(name.startsWith('sqlite3_wasm')){
209            e.classList.add('func-wasm');
210        }
211    };
212    const renderIt = async function(sqlite3){
213        self.sqlite3 = sqlite3;
214        console.warn("sqlite3 installed as global symbol self.sqlite3.");
215        const capi = sqlite3.capi;
216        const cmpIcase = (a,b)=>a.toLowerCase().localeCompare(b.toLowerCase());
217        const renderX = function(tgtElem, container, keys){
218            for(const k of keys.sort(cmpIcase)){
219                renderGeneric(k, container[k], tgtElem);
220            }
221        };
222
223        const excludeNamespace = ['scriptInfo','StructBinder'];
224        renderX(
225            E('#list-namespace'), sqlite3,
226            Object.keys(sqlite3)
227                .filter((v)=>excludeNamespace.indexOf(v)<0)
228        );
229        renderX(
230            E('#list-version'), sqlite3.version,
231            Object.keys(sqlite3.version)
232        );
233
234        /* sqlite3_...() and SQLITE_... */
235        const lists = {c: [], f: []};
236        for(const [k,v] of Object.entries(capi)){
237            if(k.startsWith('SQLITE_')) lists.c.push(k);
238            else if(k.startsWith('sqlite3_')) lists.f.push(k);
239        }
240        const excludeCapi = [
241            'sqlite3_wasmfs_filename_is_persistent',
242            'sqlite3_wasmfs_opfs_dir'
243        ];
244        lists.c.sort().forEach(renderConst);
245        lists.f
246            .filter((v)=>excludeCapi.indexOf(v)<0)
247            .sort()
248            .forEach(renderFunc);
249        lists.c = lists.f = null;
250
251        renderX(E('#list-oo1'), sqlite3.oo1,
252                Object.keys(sqlite3.oo1) );
253
254        const excludeWasm = ['ctype'];
255        renderX(E('#list-wasm'),
256                capi.wasm,
257                Object.keys(capi.wasm)
258                .filter((v)=>{
259                    return !v.startsWith('sqlite3_wasm_')
260                        && excludeWasm.indexOf(v)<0;
261                }));
262        const psKeys = Object.keys(capi.wasm.pstack);
263        psKeys.push('pointer','quota','remaining');
264        renderX(E('#list-wasm-pstack'), capi.wasm.pstack, psKeys);
265
266        const cou = capi.wasm.compileOptionUsed();
267        renderX(E('#list-compile-options'), cou, Object.keys(cou));
268    };
269
270    /**
271       This is a module object for use with the emscripten-installed
272       sqlite3InitModule() factory function.
273    */
274    const myModule = {
275        print: (...args)=>{console.log(...args)},
276        printErr: (...args)=>{console.error(...args)},
277        /**
278           Called by the Emscripten module init bits to report loading
279           progress. It gets passed an empty argument when loading is done
280           (after onRuntimeInitialized() and any this.postRun callbacks
281           have been run).
282        */
283        setStatus: function f(text){
284            if(!f.last){
285                f.last = { text: '', step: 0 };
286                f.ui = {
287                    status: E('#module-load-status')
288                };
289            }
290            if(text === f.last.text) return;
291            f.last.text = text;
292            ++f.last.step;
293            if(text) {
294                f.ui.status.classList.remove('hidden');
295                f.ui.status.innerText = text;
296            }else{
297                f.ui.status.classList.add('hidden');
298                EAll('.initially-hidden').forEach((e)=>{
299                    e.classList.remove('initially-hidden');
300                });
301            }
302        }
303    }/*myModule*/;
304    self.sqlite3InitModule(myModule).then(renderIt);
305})();</script>
306</div><!-- .fossil-doc -->
307</body></html>
308