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