module-symbols.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  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. <title>sqlite3 Module Symbols</title>
  8. <style>
  9. body {
  10. font-size: 12.5pt;
  11. padding-bottom: 1em;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <div class="fossil-doc" data-title="sqlite3 Module Symbols"><!-- EXTRACT_BEGIN -->
  17. <!--
  18. The part of this doc wrapped in div.fossil-doc gets snipped out
  19. from the canonical copy in the main tree (ext/wasm/module-symbols.html)
  20. and added to the wasm docs repository, where it's served from
  21. fossil.
  22. -->
  23. <style>
  24. .pseudolist {
  25. column-count: auto;
  26. column-width: 12rem;
  27. column-gap: 1.5em;
  28. width: 90%;
  29. margin: auto;
  30. }
  31. .pseudolist.wide {
  32. column-width: 21rem;
  33. }
  34. .pseudolist.wide2 {
  35. column-width: 25rem;
  36. }
  37. .pseudolist > span {
  38. font-family: monospace;
  39. margin: 0.25em 0;
  40. display: block;
  41. }
  42. .pseudolist.wrap-anywhere {
  43. overflow-wrap: anywhere;
  44. }
  45. .warning { color: firebrick }
  46. .error { color: firebrick; background-color: yellow}
  47. .hidden, .initially-hidden {
  48. position: absolute !important;
  49. opacity: 0 !important;
  50. pointer-events: none !important;
  51. display: none !important;
  52. }
  53. h1::before, h2::before, h3::before, h4::before {
  54. /* Remove automatic numbering */
  55. content: "" !important;
  56. background-color: transparent !important;
  57. margin: 0 !important;
  58. border: 0 !important;
  59. padding: 0 !important;
  60. }
  61. .func-wasm {
  62. }
  63. .func-wasm::after {
  64. content: "WASM";
  65. color: saddlebrown;
  66. /* ^^^^ the color must be legible in both "bright" and "dark"
  67. s ite themes. */
  68. font-size: 0.65em;
  69. /* baseline-shift: super; */
  70. vertical-align: super;
  71. }
  72. </style>
  73. <p id='module-load-status'><strong>Loading WASM module...</strong>
  74. If this takes "a long time" it may have failed and the browser's
  75. dev console may contain hints as to why.
  76. </p>
  77. <p>
  78. This page lists the SQLite3 APIs exported
  79. by <code>sqlite3.wasm</code> and exposed to clients
  80. by <code>sqlite3.js</code>. These lists are generated dynamically
  81. by loading the JS/WASM module and introspecting it, with the following
  82. caveats:
  83. </p>
  84. <ul>
  85. <li>Some APIs are explicitly filtered out of these lists because
  86. they are strictly for internal use within the JS/WASM APIs and
  87. its own test code.
  88. </li>
  89. <li>This page runs in the main UI thread so cannot see features
  90. which are only available in a Worker thread. If this page were
  91. to function via a Worker, it would not be able to see
  92. functionality only available in the main thread. Either way, it
  93. would be missing certain APIs.
  94. </li>
  95. </ul>
  96. <div class='initially-hidden'>
  97. <p>This page exposes a global symbol named <code>sqlite3</code>
  98. which can be inspected using the browser's dev tools.
  99. </p>
  100. <p>Jump to...</p>
  101. <ul>
  102. <li><a href='#sqlite3-namespace'><code>sqlite3</code> namespace</a></li>
  103. <li><a href='#sqlite3-version'><code>sqlite3.version</code> object</a></li>
  104. <li><a href='#sqlite3-functions'><code>sqlite3_...()</code> functions</a></li>
  105. <li><a href='#sqlite3-constants'><code>SQLITE_...</code> constants</a></li>
  106. <li><a href='#sqlite3.oo1'><code>sqlite3.oo1</code> namespace</a>
  107. <!--ul>
  108. <li><a href='#sqlite3.oo1.DB'><code>sqlite3.oo1.DB</code></a></li>
  109. <li><a href='#sqlite3.oo1.Stmt'><code>sqlite3.oo1.Stmt</code></a></li>
  110. </ul-->
  111. </li>
  112. <li><a href='#sqlite3.wasm'><code>sqlite3.wasm</code> namespace</a></li>
  113. <li><a href='#sqlite3.wasm.pstack'><code>sqlite3.wasm.pstack</code> namespace</a></li>
  114. <li><a href='#compile-options'>Compilation options used in this module build</a></li>
  115. </ul>
  116. <a id="sqlite3-namespace"></a>
  117. <h1><code>sqlite3</code> Namespace</h1>
  118. <p>
  119. The <code>sqlite3</code> namespace object exposes the following...
  120. </p>
  121. <div id='list-namespace' class='pseudolist'></div>
  122. <a id="sqlite3-version"></a>
  123. <h1><code>sqlite3.version</code> Object</h1>
  124. <p>
  125. The <code>sqlite3.version</code> object exposes the following...
  126. </p>
  127. <div id='list-version' class='pseudolist wide wrap-anywhere'></div>
  128. <a id="sqlite3-functions"></a>
  129. <h1><code>sqlite3_...()</code> Function List</h1>
  130. <p>The <code>sqlite3.capi</code> namespace exposes the following
  131. <a href='https://sqlite.org/c3ref/funclist.html'><code>sqlite3_...()</code>
  132. functions</a>...
  133. </p>
  134. <div id='list-functions' class='pseudolist wide'></div>
  135. <p>
  136. <code class='func-wasm'></code> = function is specific to the JS/WASM
  137. bindings, not part of the C API.
  138. </p>
  139. <a id="sqlite3-constants"></a>
  140. <h1><code>SQLITE_...</code> Constants</h1>
  141. <p>The <code>sqlite3.capi</code> namespace exposes the following
  142. <a href='https://sqlite.org/c3ref/constlist.html'><code>SQLITE_...</code>
  143. constants</a>...
  144. </p>
  145. <div id='list-constants' class='pseudolist wide'></div>
  146. <a id="sqlite3.oo1"></a>
  147. <h1><code>sqlite3.oo1</code> Namespace</h1>
  148. <p>
  149. The <code>sqlite3.oo1</code> namespace exposes the following...
  150. </p>
  151. <div id='list-oo1' class='pseudolist'></div>
  152. <a id="sqlite3.wasm"></a>
  153. <h1><code>sqlite3.wasm</code> Namespace</h1>
  154. <p>
  155. The <code>sqlite3.wasm</code> namespace exposes the
  156. following...
  157. </p>
  158. <div id='list-wasm' class='pseudolist'></div>
  159. <a id="sqlite3.wasm.pstack"></a>
  160. <h1><code>sqlite3.wasm.pstack</code> Namespace</h1>
  161. <p>
  162. The <code>sqlite3.wasm.pstack</code> namespace exposes the
  163. following...
  164. </p>
  165. <div id='list-wasm-pstack' class='pseudolist'></div>
  166. <a id="compile-options"></a>
  167. <h1>Compilation Options</h1>
  168. <p>
  169. <code>SQLITE_...</code> compilation options used in this build
  170. of <code>sqlite3.wasm</code>...
  171. </p>
  172. <div id='list-compile-options' class='pseudolist wide2'></div>
  173. </div><!-- .initially-hidden -->
  174. <script src="jswasm/sqlite3.js">/* This tag MUST be inside the
  175. fossil-doc block so that this part can work without modification in
  176. the wasm docs repo. */</script>
  177. <script>(async function(){
  178. const apiLinks = Object.assign(Object.create(null),{
  179. sqlite3_aggregate_context: 'www:/c3ref/aggregate_context.html',
  180. sqlite3_auto_extension: 'wasm:/api-c-style.md#auto-extension',
  181. sqlite3_bind_blob: 'www:/c3ref/bind_blob.html',
  182. sqlite3_bind_double: 'www:/c3ref/bind_blob.html',
  183. sqlite3_bind_int: 'www:/c3ref/bind_blob.html',
  184. sqlite3_bind_int64: 'www:/c3ref/bind_blob.html',
  185. sqlite3_bind_null: 'www:/c3ref/bind_blob.html',
  186. sqlite3_bind_parameter_count: 'www:/c3ref/bind_parameter_count.html',
  187. sqlite3_bind_parameter_index: 'www:/c3ref/bind_parameter_index.html',
  188. sqlite3_bind_pointer: 'www:/c3ref/bind_blob.html',
  189. sqlite3_bind_text: 'www:/c3ref/bind_blob.html',
  190. sqlite3_busy_handler: 'www:/c3ref/busy_handler.html',
  191. sqlite3_busy_timeout: 'www:/c3ref/busy_timeout.html',
  192. sqlite3_cancel_auto_extension: 'wasm:/api-c-style.md#auto-extension',
  193. sqlite3_changes: 'www:/c3ref/changes.html',
  194. sqlite3_changes64: 'www:/c3ref/changes.html',
  195. sqlite3_clear_bindings: 'www:/c3ref/clear_bindings.html',
  196. sqlite3_close_v2: 'www:/c3ref/close.html',
  197. sqlite3_collation_needed: 'www:/c3ref/collation_needed.html',
  198. sqlite3_column_blob: 'www:/c3ref/column_blob.html',
  199. sqlite3_column_bytes: 'www:/c3ref/column.html',
  200. sqlite3_column_count: 'www:/c3ref/column_count.html',
  201. sqlite3_column_double: 'www:/c3ref/column_blob.html',
  202. sqlite3_column_int: 'www:/c3ref/column_blob.html',
  203. sqlite3_column_int64: 'www:/c3ref/column_blob.html',
  204. sqlite3_column_name: 'www:/c3ref/column_name.html',
  205. sqlite3_column_text: 'www:/c3ref/column_blob.html',
  206. sqlite3_column_type: 'www:/c3ref/column_blob.html',
  207. sqlite3_column_value: 'www:/c3ref/column_blob.html',
  208. sqlite3_commit_hook: 'wasm:/api-c-style.md#hook-api',
  209. sqlite3_compileoption_get: 'www:/c3ref/compileoption_get.html',
  210. sqlite3_compileoption_used: 'www:/c3ref/compileoption_get.html',
  211. sqlite3_complete: 'www:/c3ref/complete.html',
  212. sqlite3_config: 'www:/c3ref/config.html',
  213. sqlite3_context_db_handle: 'www:/c3ref/context_db_handle.html',
  214. sqlite3_create_collation: 'www:/c3ref/create_collation.html',
  215. sqlite3_create_collation_v2: 'www:/c3ref/create_collation.html',
  216. sqlite3_create_function: 'wasm:/api-c-style.md#sqlite3_create_function',
  217. sqlite3_create_function_v2: 'wasm:/api-c-style.md#sqlite3_create_function',
  218. sqlite3_create_module: 'www:/c3ref/create_module.html',
  219. sqlite3_create_module_v2: 'www:/c3ref/create_module.html',
  220. sqlite3_create_window_function: 'wasm:/api-c-style.md#sqlite3_create_function',
  221. sqlite3_db_config: 'wasm:/api-c-style.md#sqlite3_db_config',
  222. sqlite3_data_count: 'www:/c3ref/data_count.html',
  223. sqlite3_db_filename: 'www:/c3ref/db_filename.html',
  224. sqlite3_db_handle: 'www:/c3ref/db_handle.html',
  225. sqlite3_db_name: 'www:/c3ref/db_name.html',
  226. sqlite3_db_status: 'www:/c3ref/db_status.html',
  227. sqlite3_declare_vtab: 'www:/c3ref/declare_vtab.html',
  228. sqlite3_deserialize: 'wasm:/api-c-style.md#sqlite3_deserialize',
  229. sqlite3_drop_modules: 'www:/c3ref/drop_modules.html',
  230. sqlite3_errcode: 'www:/c3ref/errcode.html',
  231. sqlite3_errmsg: 'www:/c3ref/errcode.html',
  232. sqlite3_error_offset: 'www:/c3ref/error_offset.html',
  233. sqlite3_errstr: 'www:/c3ref/errcode.html',
  234. sqlite3_exec: 'wasm:/api-c-style.md#sqlite3_exec',
  235. sqlite3_expanded_sql: 'www:/c3ref/expanded_sql.html',
  236. sqlite3_extended_errcode: 'www:/c3ref/errcode.html',
  237. sqlite3_extended_result_codes: 'www:/c3ref/extended_result_codes.html',
  238. sqlite3_file_control: 'www:/c3ref/file_control.html',
  239. sqlite3_finalize: 'www:/c3ref/finalize.html',
  240. sqlite3_free: 'www:/c3ref/free.html',
  241. sqlite3_get_auxdata: 'www:/c3ref/get_auxdata.html',
  242. sqlite3_initialize: 'www:/c3ref/initialize.html',
  243. sqlite3_keyword_check: 'www:/c3ref/keyword_check.html',
  244. sqlite3_keyword_count: 'www:/c3ref/keyword_check.html',
  245. sqlite3_keyword_name: 'www:/c3ref/keyword_check.html',
  246. sqlite3_last_insert_rowid: 'www:/c3ref/last_insert_rowid.html',
  247. sqlite3_libversion: 'www:/c3ref/libversion.html',
  248. sqlite3_libversion_number: 'www:/c3ref/libversion.html',
  249. sqlite3_limit: 'www:/c3ref/limit.html',
  250. sqlite3_malloc: 'www:/c3ref/free.html',
  251. sqlite3_malloc64: 'www:/c3ref/free.html',
  252. sqlite3_msize: 'www:/c3ref/free.html',
  253. sqlite3_open: 'www:/c3ref/open.html',
  254. sqlite3_open_v2: 'www:/c3ref/open.html',
  255. sqlite3_overload_function: 'www:/c3ref/overload_function.html',
  256. sqlite3_prepare_v2: 'wasm:/api-c-style.md#sqlite3_prepare_v2',
  257. sqlite3_prepare_v3: 'wasm:/api-c-style.md#sqlite3_prepare_v2',
  258. sqlite3_progress_handler: 'www:/c3ref/progress_handler.html',
  259. sqlite3_randomness: 'wasm:/api-c-style.md#sqlite3_randomness',
  260. sqlite3_realloc: 'www:/c3ref/free.html',
  261. sqlite3_realloc64: 'www:/c3ref/free.html',
  262. sqlite3_reset: 'www:/c3ref/reset.html',
  263. sqlite3_reset_auto_extension: 'wasm:/api-c-style.md#auto-extension',
  264. sqlite3_result_blob: 'www:/c3ref/result_blob.html',
  265. sqlite3_result_double: 'www:/c3ref/result_blob.html',
  266. sqlite3_result_error: 'www:/c3ref/result_blob.html',
  267. sqlite3_result_error_code: 'www:/c3ref/result_blob.html',
  268. sqlite3_result_error_nomem: 'www:/c3ref/result_blob.html',
  269. sqlite3_result_error_toobig: 'www:/c3ref/result_blob.html',
  270. sqlite3_result_int: 'www:/c3ref/result_blob.html',
  271. sqlite3_result_int64: 'www:/c3ref/result_blob.html',
  272. sqlite3_result_null: 'www:/c3ref/result_blob.html',
  273. sqlite3_result_pointer: 'www:/c3ref/result_blob.html',
  274. sqlite3_result_subtype: 'www:/c3ref/result_subtype.html',
  275. sqlite3_result_text: 'www:/c3ref/result_blob.html',
  276. sqlite3_result_zeroblob: 'www:/c3ref/result_blob.html',
  277. sqlite3_result_zeroblob64: 'www:/c3ref/result_blob.html',
  278. sqlite3_rollback_hook: 'wasm:/api-c-style.md#hook-api',
  279. sqlite3_serialize: 'www:/c3ref/serialize.html',
  280. sqlite3_set_authorizer: 'wasm:/api-c-style.md#sqlite3_set_authorizer',
  281. sqlite3_set_auxdata: 'www:/c3ref/get_auxdata.html',
  282. sqlite3_set_last_insert_rowid: 'www:/c3ref/set_last_insert_rowid',
  283. sqlite3_shutdown: 'www:/c3ref/initialize.html',
  284. sqlite3_sourceid: 'www:/c3ref/libversion.html',
  285. sqlite3_sql: 'www:/c3ref/expanded_sql.html',
  286. sqlite3_status: 'www:/c3ref/status.html',
  287. sqlite3_status64: 'www:/c3ref/status.html',
  288. sqlite3_step: 'www:/c3ref/step.html',
  289. sqlite3_stmt_isexplain: 'www:/c3ref/stmt_isexplain.html',
  290. sqlite3_stmt_readonly: 'www:/c3ref/stmt_readonly.html',
  291. sqlite3_stmt_status: 'www:/c3ref/stmt_status.html',
  292. sqlite3_strglob: 'www:/c3ref/strglob.html',
  293. sqlite3_stricmp: 'www:/c3ref/stricmp.html',
  294. sqlite3_strlike: 'www:/c3ref/strlike.html',
  295. sqlite3_strnicmp: 'www:/c3ref/strnicmp.html',
  296. sqlite3_table_column_metadata: 'www:/c3ref/table_column_metadata.html',
  297. sqlite3_total_changes: 'www:/c3ref/total_changes.html',
  298. sqlite3_total_changes64: 'www:/c3ref/total_changes.html',
  299. sqlite3_trace_v2: 'www:/c3ref/trace_v2.html',
  300. sqlite3_txn_state: 'www:/c3ref/txn_state.html',
  301. sqlite3_update_hook: 'wasm:/api-c-style.md#hook-api',
  302. sqlite3_uri_boolean: 'www:/c3ref/uri_boolean.html',
  303. sqlite3_uri_int64: 'www:/c3ref/uri_boolean.html',
  304. sqlite3_uri_key: 'www:/c3ref/uri_boolean.html',
  305. sqlite3_uri_parameter: 'www:/c3ref/uri_boolean.html',
  306. sqlite3_user_data: 'www:/c3ref/user_data.html',
  307. sqlite3_value_blob: 'www:/c3ref/value_blob.html',
  308. sqlite3_value_bytes: 'www:/c3ref/value_blob.html',
  309. sqlite3_value_double: 'www:/c3ref/value_blob.html',
  310. sqlite3_value_dup: 'www:/c3ref/value_dup.html',
  311. sqlite3_value_free: 'www:/c3ref/value_dup.html',
  312. sqlite3_value_frombind: 'www:/c3ref/value_blob.html',
  313. sqlite3_value_int: 'www:/c3ref/value_blob.html',
  314. sqlite3_value_int64: 'www:/c3ref/value_blob.html',
  315. sqlite3_value_nochange: 'www:/c3ref/value_blob.html',
  316. sqlite3_value_numeric_type: 'www:/c3ref/value_blob.html',
  317. sqlite3_value_pointer: 'www:/c3ref/value_blob.html',
  318. sqlite3_value_subtype: 'www:/c3ref/value_subtype.html',
  319. sqlite3_value_text: 'www:/c3ref/value_blob.html',
  320. sqlite3_value_type: 'www:/c3ref/value_blob.html',
  321. sqlite3_vfs_find: 'www:/c3ref/vfs_find.html',
  322. sqlite3_vfs_register: 'www:/c3ref/vfs_find.html',
  323. sqlite3_vfs_unregister: 'www:/c3ref/vfs_find.html',
  324. sqlite3_vtab_collation: 'www:/c3ref/vtab_collation.html',
  325. sqlite3_vtab_config: 'www:/c3ref/vtab_config.html',
  326. sqlite3_vtab_distinct: 'www:/c3ref/vtab_distinct.html',
  327. sqlite3_vtab_in: 'www:/c3ref/vtab_in.html',
  328. sqlite3_vtab_in_first: 'www:/c3ref/vtab_in_first.html',
  329. sqlite3_vtab_in_next: 'www:/c3ref/vtab_in_next.html',
  330. sqlite3_vtab_nochange: 'www:/c3ref/vtab_nochange.html',
  331. sqlite3_vtab_on_conflict: 'www:/c3ref/vtab_on_conflict.html',
  332. sqlite3_vtab_rhs_value: 'www:/c3ref/vtab_rhs_value.html',
  333. sqlite3_column_js: 'wasm:/api-c-style.md#sqlite3_column_js',
  334. sqlite3_js_aggregate_context: 'wasm:/api-c-style.md#sqlite3_js_aggregate_context',
  335. sqlite3_js_db_export: 'wasm:/api-c-style.md#sqlite3_js_db_export',
  336. sqlite3_js_db_uses_vfs: 'wasm:/api-c-style.md#sqlite3_js_db_uses_vfs',
  337. sqlite3_js_db_vfs: 'wasm:/api-c-style.md#sqlite3_js_db_vfs',
  338. sqlite3_js_kvvfs_clear: 'wasm:/api-c-style.md#sqlite3_js_kvvfs',
  339. sqlite3_js_kvvfs_size: 'wasm:/api-c-style.md#sqlite3_js_kvvfs',
  340. sqlite3_js_posix_create_file: 'wasm:/api-c-style.md#sqlite3_js_posix_create_file',
  341. sqlite3_js_rc_str: 'wasm:/api-c-style.md#sqlite3_js_rc_str',
  342. sqlite3_js_vfs_create_file: 'wasm:/api-c-style.md#sqlite3_js_vfs_create_file',
  343. sqlite3_js_vfs_list: 'wasm:/api-c-style.md#sqlite3_js_vfs_list',
  344. sqlite3_result_error_js: 'wasm:/api-c-style.md#sqlite3_result_error_js',
  345. sqlite3_result_js: 'wasm:/api-c-style.md#sqlite3_result_js',
  346. sqlite3_value_to_js: 'wasm:/api-c-style.md#sqlite3_value_to_js',
  347. sqlite3_values_to_js: 'wasm:/api-c-style.md#sqlite3_values_to_js',
  348. xform: (v)=>{
  349. if(v){
  350. return v.replace('www:','https://sqlite.org')
  351. .replace('wasm:','https://sqlite.org/wasm/doc/trunk');
  352. }else{
  353. return undefined;
  354. }
  355. }
  356. });
  357. const eNew = (tag,parent)=>{
  358. const e = document.createElement(tag);
  359. if(parent) parent.appendChild(e);
  360. return e;
  361. };
  362. const eLi = (label,parent)=>{
  363. const e = eNew('span',parent);
  364. e.innerText = label;
  365. return e;
  366. };
  367. const eLink = (label,url,parent)=>{
  368. const w = eNew('span',parent);
  369. const e = eNew('a',w);
  370. if(url){
  371. e.href = url;
  372. e.target = 'sqlite3-api-docs';
  373. }
  374. e.innerText = label;
  375. return w;
  376. };
  377. const E = (sel)=>document.querySelector(sel);
  378. const EAll = (sel)=>document.querySelectorAll(sel);
  379. const eFuncs = E('#list-functions'),
  380. eConst = E('#list-constants');
  381. const renderConst = function(name){
  382. eLi(name, eConst);
  383. };
  384. const renderFunc = function(name){
  385. let lbl = name+'()';
  386. const e = eLink(lbl, apiLinks.xform(apiLinks[name]), eFuncs);
  387. if(name.indexOf('_js')>0
  388. || name.indexOf('_wasm')>0){
  389. e.classList.add('func-wasm');
  390. }
  391. };
  392. const renderGeneric = function(name,value,eParent){
  393. let lbl;
  394. if(value instanceof Function) lbl = name+'()';
  395. else{
  396. switch(typeof value){
  397. case 'number': case 'boolean': case 'string':
  398. lbl = name+' = '+JSON.stringify(value);
  399. break;
  400. default:
  401. lbl = name + ' ['+(typeof value)+']';
  402. }
  403. }
  404. const e = eLi(lbl, eParent);
  405. if(name.startsWith('sqlite3_wasm')){
  406. e.classList.add('func-wasm');
  407. }
  408. };
  409. const renderIt = async function(sqlite3){
  410. self.sqlite3 = sqlite3;
  411. console.warn("sqlite3 installed as global symbol self.sqlite3.");
  412. const capi = sqlite3.capi, wasm = sqlite3.wasm;
  413. const cmpIcase = (a,b)=>a.toLowerCase().localeCompare(b.toLowerCase());
  414. const renderX = function(tgtElem, container, keys){
  415. for(const k of keys.sort(cmpIcase)){
  416. renderGeneric(k, container[k], tgtElem);
  417. }
  418. };
  419. const excludeNamespace = ['scriptInfo','StructBinder'];
  420. renderX(
  421. E('#list-namespace'), sqlite3,
  422. Object.keys(sqlite3)
  423. .filter((v)=>excludeNamespace.indexOf(v)<0)
  424. );
  425. renderX(
  426. E('#list-version'), sqlite3.version,
  427. Object.keys(sqlite3.version)
  428. );
  429. /* sqlite3_...() and SQLITE_... */
  430. const lists = {c: [/*constants*/], f: [/*functions*/],
  431. s: [/*structs*/]};
  432. /* Exclude these from the function list... */
  433. const excludeCapi = [
  434. // WASMFS stuff:
  435. 'sqlite3_wasmfs_filename_is_persistent',
  436. 'sqlite3_wasmfs_opfs_dir'
  437. ];
  438. for(const [k,v] of Object.entries(capi)){
  439. if(k.startsWith('SQLITE_')){
  440. lists.c.push(k);
  441. }else if(k.startsWith('sqlite3_')){
  442. if(excludeCapi.indexOf(k)>=0) continue;
  443. if(v.structInfo){
  444. // assume this is a StructType-type.
  445. continue;
  446. }
  447. lists.f.push(k);
  448. }
  449. }
  450. lists.c.sort().forEach(renderConst);
  451. lists.f.sort().forEach(renderFunc);
  452. lists.c = lists.f = null;
  453. renderX(E('#list-oo1'), sqlite3.oo1,
  454. Object.keys(sqlite3.oo1) );
  455. const excludeWasm = ['ctype'];
  456. renderX(E('#list-wasm'),
  457. wasm, Object.keys(wasm).filter((v)=>{
  458. return !v.startsWith('sqlite3_wasm_')
  459. && excludeWasm.indexOf(v)<0;
  460. }));
  461. const psKeys = Object.keys(wasm.pstack);
  462. psKeys.push('pointer','quota','remaining');
  463. renderX(E('#list-wasm-pstack'), wasm.pstack, psKeys);
  464. const cou = wasm.compileOptionUsed();
  465. //const cou2 = Object.create(null);
  466. //Object.entries(cou).forEach((e)=>cou2['SQLITE_'+e[0]] = e[1]);
  467. renderX(E('#list-compile-options'), cou, Object.keys(cou));
  468. };
  469. /**
  470. This is a module object for use with the emscripten-installed
  471. sqlite3InitModule() factory function.
  472. */
  473. const myModule = {
  474. print: (...args)=>{console.log(...args)},
  475. printErr: (...args)=>{console.error(...args)},
  476. /**
  477. Called by the Emscripten module init bits to report loading
  478. progress. It gets passed an empty argument when loading is done
  479. (after onRuntimeInitialized() and any this.postRun callbacks
  480. have been run).
  481. */
  482. setStatus: function f(text){
  483. if(!f.last){
  484. f.last = { text: '', step: 0 };
  485. f.ui = {
  486. status: E('#module-load-status')
  487. };
  488. }
  489. if(text === f.last.text) return;
  490. f.last.text = text;
  491. ++f.last.step;
  492. if(text) {
  493. f.ui.status.classList.remove('hidden');
  494. f.ui.status.innerText = text;
  495. }else{
  496. f.ui.status.classList.add('hidden');
  497. EAll('.initially-hidden').forEach((e)=>{
  498. e.classList.remove('initially-hidden');
  499. });
  500. }
  501. }
  502. }/*myModule*/;
  503. self.sqlite3InitModule(myModule).then(renderIt);
  504. })();</script>
  505. </div><!-- .fossil-doc EXTRACT_END -->
  506. </body></html>