| 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_posix_create_file: 'wasm:/api-c-style.md#sqlite3_js_posix_create_file', |
| 366 |
sqlite3_js_rc_str: 'wasm:/api-c-style.md#sqlite3_js_rc_str', |
| 367 |
sqlite3_js_vfs_create_file: 'wasm:/api-c-style.md#sqlite3_js_vfs_create_file', |
| 368 |
sqlite3_js_vfs_list: 'wasm:/api-c-style.md#sqlite3_js_vfs_list', |
| 369 |
sqlite3_result_error_js: 'wasm:/api-c-style.md#sqlite3_result_error_js', |
| 370 |
sqlite3_result_js: 'wasm:/api-c-style.md#sqlite3_result_js', |
| 371 |
sqlite3_value_to_js: 'wasm:/api-c-style.md#sqlite3_value_to_js', |
| 372 |
sqlite3_values_to_js: 'wasm:/api-c-style.md#sqlite3_values_to_js', |
| 373 |
|
| 374 |
xform: (v)=>{ |
| 375 |
if(v){ |
| 376 |
return v.replace('www:','https://sqlite.org') |
| 377 |
.replace('wasm:','https://sqlite.org/wasm/doc/trunk'); |
| 378 |
}else{ |
| 379 |
return undefined; |
| 380 |
} |
| 381 |
} |
| 382 |
}); |
| 383 |
const eNew = (tag,parent)=>{ |
| 384 |
const e = document.createElement(tag); |
| 385 |
if(parent) parent.appendChild(e); |
| 386 |
return e; |
| 387 |
}; |
| 388 |
const eLi = (label,parent)=>{ |
| 389 |
const e = eNew('span',parent); |
| 390 |
e.innerText = label; |
| 391 |
return e; |
| 392 |
}; |
| 393 |
const eLink = (label,url,parent)=>{ |
| 394 |
const w = eNew('span',parent); |
| 395 |
const e = eNew('a',w); |
| 396 |
if(url){ |
| 397 |
e.href = url; |
| 398 |
e.target = 'sqlite3-api-docs'; |
| 399 |
} |
| 400 |
e.innerText = label; |
| 401 |
return w; |
| 402 |
}; |
| 403 |
const E = (sel)=>document.querySelector(sel); |
| 404 |
const EAll = (sel)=>document.querySelectorAll(sel); |
| 405 |
const eFuncs = E('#list-functions'), |
| 406 |
eConst = E('#list-constants'); |
| 407 |
const renderConst = function(name){ |
| 408 |
eLi(name, eConst); |
| 409 |
}; |
| 410 |
const renderFunc = function(name){ |
| 411 |
let lbl = name+'()'; |
| 412 |
const e = eLink(lbl, apiLinks.xform(apiLinks[name]), eFuncs); |
| 413 |
if(name.indexOf('_js')>0 |
| 414 |
|| name.indexOf('_wasm')>0){ |
| 415 |
e.classList.add('func-wasm'); |
| 416 |
} |
| 417 |
}; |
| 418 |
const renderGeneric = function(name,value,eParent){ |
| 419 |
let lbl; |
| 420 |
if(value instanceof Function) lbl = name+'()'; |
| 421 |
else{ |
| 422 |
switch(typeof value){ |
| 423 |
case 'number': case 'boolean': case 'string': |
| 424 |
lbl = name+' = '+JSON.stringify(value); |
| 425 |
break; |
| 426 |
default: |
| 427 |
lbl = name + ' ['+(typeof value)+']'; |
| 428 |
} |
| 429 |
} |
| 430 |
const e = eLi(lbl, eParent); |
| 431 |
if(name.startsWith('sqlite3_wasm')){ |
| 432 |
e.classList.add('func-wasm'); |
| 433 |
} |
| 434 |
}; |
| 435 |
const renderIt = async function(sqlite3){ |
| 436 |
self.sqlite3 = sqlite3; |
| 437 |
console.warn("sqlite3 installed as global symbol self.sqlite3."); |
| 438 |
const capi = sqlite3.capi, wasm = sqlite3.wasm; |
| 439 |
const cmpIcase = (a,b)=>a.toLowerCase().localeCompare(b.toLowerCase()); |
| 440 |
const renderX = function(tgtElem, container, keys){ |
| 441 |
for(const k of keys.sort(cmpIcase)){ |
| 442 |
renderGeneric(k, container[k], tgtElem); |
| 443 |
} |
| 444 |
}; |
| 445 |
|
| 446 |
const excludeNamespace = ['scriptInfo','StructBinder']; |
| 447 |
renderX( |
| 448 |
E('#list-namespace'), sqlite3, |
| 449 |
Object.keys(sqlite3) |
| 450 |
.filter((v)=>excludeNamespace.indexOf(v)<0) |
| 451 |
); |
| 452 |
renderX( |
| 453 |
E('#list-version'), sqlite3.version, |
| 454 |
Object.keys(sqlite3.version) |
| 455 |
); |
| 456 |
|
| 457 |
/* sqlite3_...() and SQLITE_... */ |
| 458 |
const lists = {c: [/*constants*/], f: [/*functions*/], |
| 459 |
s: [/*structs*/]}; |
| 460 |
/* Exclude these from the function list... */ |
| 461 |
const excludeCapi = [ |
| 462 |
// WASMFS stuff: |
| 463 |
'sqlite3_wasmfs_filename_is_persistent', |
| 464 |
'sqlite3_wasmfs_opfs_dir' |
| 465 |
]; |
| 466 |
for(const [k,v] of Object.entries(capi)){ |
| 467 |
if(k.startsWith('SQLITE_')){ |
| 468 |
lists.c.push(k); |
| 469 |
}else if(k.startsWith('sqlite3_')){ |
| 470 |
if(excludeCapi.indexOf(k)>=0) continue; |
| 471 |
if(v.structInfo){ |
| 472 |
// assume this is a StructType-type. |
| 473 |
continue; |
| 474 |
} |
| 475 |
lists.f.push(k); |
| 476 |
} |
| 477 |
} |
| 478 |
lists.c.sort().forEach(renderConst); |
| 479 |
lists.f.sort().forEach(renderFunc); |
| 480 |
lists.c = lists.f = null; |
| 481 |
|
| 482 |
renderX(E('#list-oo1'), sqlite3.oo1, |
| 483 |
Object.keys(sqlite3.oo1) ); |
| 484 |
|
| 485 |
const excludeWasm = ['ctype']; |
| 486 |
renderX(E('#list-wasm'), |
| 487 |
wasm, Object.keys(wasm).filter((v)=>{ |
| 488 |
return !v.startsWith('sqlite3_wasm_') |
| 489 |
&& excludeWasm.indexOf(v)<0; |
| 490 |
})); |
| 491 |
const psKeys = Object.keys(wasm.pstack); |
| 492 |
psKeys.push('pointer','quota','remaining'); |
| 493 |
renderX(E('#list-wasm-pstack'), wasm.pstack, psKeys); |
| 494 |
|
| 495 |
const pwKeys = Object.keys(wasm.ptr); |
| 496 |
renderX(E('#list-wasm-ptr'), wasm.ptr, pwKeys); |
| 497 |
|
| 498 |
const cou = wasm.compileOptionUsed(); |
| 499 |
//const cou2 = Object.create(null); |
| 500 |
//Object.entries(cou).forEach((e)=>cou2['SQLITE_'+e[0]] = e[1]); |
| 501 |
renderX(E('#list-compile-options'), cou, Object.keys(cou)); |
| 502 |
}; |
| 503 |
|
| 504 |
/** |
| 505 |
This is a module object for use with the emscripten-installed |
| 506 |
sqlite3InitModule() factory function. |
| 507 |
*/ |
| 508 |
const myModule = { |
| 509 |
print: (...args)=>{console.log(...args)}, |
| 510 |
printErr: (...args)=>{console.error(...args)}, |
| 511 |
/** |
| 512 |
Called by the Emscripten module init bits to report loading |
| 513 |
progress. It gets passed an empty argument when loading is done |
| 514 |
(after onRuntimeInitialized() and any this.postRun callbacks |
| 515 |
have been run). |
| 516 |
*/ |
| 517 |
setStatus: function f(text){ |
| 518 |
if(!f.last){ |
| 519 |
f.last = { text: '', step: 0 }; |
| 520 |
f.ui = { |
| 521 |
status: E('#module-load-status') |
| 522 |
}; |
| 523 |
} |
| 524 |
if(text === f.last.text) return; |
| 525 |
f.last.text = text; |
| 526 |
++f.last.step; |
| 527 |
if(text) { |
| 528 |
f.ui.status.classList.remove('hidden'); |
| 529 |
f.ui.status.innerText = text; |
| 530 |
}else{ |
| 531 |
f.ui.status.classList.add('hidden'); |
| 532 |
EAll('.initially-hidden').forEach((e)=>{ |
| 533 |
e.classList.remove('initially-hidden'); |
| 534 |
}); |
| 535 |
} |
| 536 |
} |
| 537 |
}/*myModule*/; |
| 538 |
self.sqlite3InitModule(myModule).then(renderIt); |
| 539 |
})();</script> |
| 540 |
</div><!-- .fossil-doc EXTRACT_END --> |
| 541 |
</body></html> |