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