Skip to content

Commit

Permalink
Merge pull request #136 from rhashimoto/augment-exports
Browse files Browse the repository at this point in the history
Export all SQLite3 API functions, plus Emscripten utilities.
  • Loading branch information
rhashimoto authored Dec 9, 2023
2 parents 83b377e + 253d5e6 commit 4aa5a32
Show file tree
Hide file tree
Showing 7 changed files with 482 additions and 201 deletions.
233 changes: 134 additions & 99 deletions dist/wa-sqlite-async.mjs

Large diffs are not rendered by default.

Binary file modified dist/wa-sqlite-async.wasm
Binary file not shown.
224 changes: 129 additions & 95 deletions dist/wa-sqlite.mjs

Large diffs are not rendered by default.

Binary file modified dist/wa-sqlite.wasm
Binary file not shown.
208 changes: 204 additions & 4 deletions src/exported_functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,255 @@
"_main",
"_malloc",
"_free",
"_sqlite3_aggregate_context",
"_sqlite3_auto_extension",
"_sqlite3_autovacuum_pages",
"_sqlite3_backup_finish",
"_sqlite3_backup_init",
"_sqlite3_backup_pagecount",
"_sqlite3_backup_remaining",
"_sqlite3_backup_step",
"_sqlite3_bind_blob",
"_sqlite3_bind_blob64",
"_sqlite3_bind_double",
"_sqlite3_bind_int",
"_sqlite3_bind_int64",
"_sqlite3_bind_null",
"_sqlite3_bind_parameter_name",
"_sqlite3_bind_parameter_count",
"_sqlite3_bind_parameter_index",
"_sqlite3_bind_parameter_name",
"_sqlite3_bind_pointer",
"_sqlite3_bind_text",
"_sqlite3_bind_text16",
"_sqlite3_bind_text64",
"_sqlite3_bind_value",
"_sqlite3_bind_zeroblob",
"_sqlite3_bind_zeroblob64",
"_sqlite3_blob_bytes",
"_sqlite3_blob_close",
"_sqlite3_blob_open",
"_sqlite3_blob_read",
"_sqlite3_blob_reopen",
"_sqlite3_blob_write",
"_sqlite3_busy_handler",
"_sqlite3_busy_timeout",
"_sqlite3_cancel_auto_extension",
"_sqlite3_changes",
"_sqlite3_changes64",
"_sqlite3_clear_bindings",
"_sqlite3_close",
"_sqlite3_close_v2",
"_sqlite3_collation_needed",
"_sqlite3_collation_needed16",
"_sqlite3_column_blob",
"_sqlite3_column_bytes",
"_sqlite3_column_bytes16",
"_sqlite3_column_count",
"_sqlite3_column_double",
"_sqlite3_column_int",
"_sqlite3_column_int64",
"_sqlite3_column_name",
"_sqlite3_column_name16",
"_sqlite3_column_text",
"_sqlite3_column_text16",
"_sqlite3_column_type",
"_sqlite3_column_value",
"_sqlite3_commit_hook",
"_sqlite3_compileoption_get",
"_sqlite3_compileoption_used",
"_sqlite3_complete",
"_sqlite3_complete16",
"_sqlite3_config",
"_sqlite3_context_db_handle",
"_sqlite3_create_collation",
"_sqlite3_create_collation16",
"_sqlite3_create_collation_v2",
"_sqlite3_create_filename",
"_sqlite3_create_function",
"_sqlite3_create_function16",
"_sqlite3_create_function_v2",
"_sqlite3_create_module",
"_sqlite3_create_module_v2",
"_sqlite3_create_window_function",
"_sqlite3_data_count",
"_sqlite3_database_file_object",
"_sqlite3_db_cacheflush",
"_sqlite3_db_config",
"_sqlite3_db_filename",
"_sqlite3_db_handle",
"_sqlite3_db_mutex",
"_sqlite3_db_name",
"_sqlite3_db_readonly",
"_sqlite3_db_release_memory",
"_sqlite3_db_status",
"_sqlite3_declare_vtab",
"_sqlite3_deserialize",
"_sqlite3_drop_modules",
"_sqlite3_errcode",
"_sqlite3_errmsg",
"_sqlite3_errmsg16",
"_sqlite3_error_offset",
"_sqlite3_errstr",
"_sqlite3_exec",
"_sqlite3_expanded_sql",
"_sqlite3_extended_errcode",
"_sqlite3_extended_result_codes",
"_sqlite3_file_control",
"_sqlite3_filename_database",
"_sqlite3_filename_journal",
"_sqlite3_filename_wal",
"_sqlite3_finalize",
"_sqlite3_free",
"_sqlite3_free_filename",
"_sqlite3_free_table",
"_sqlite3_get_autocommit",
"_sqlite3_get_auxdata",
"_sqlite3_get_clientdata",
"_sqlite3_get_table",
"_sqlite3_hard_heap_limit64",
"_sqlite3_initialize",
"_sqlite3_interrupt",
"_sqlite3_is_interrupted",
"_sqlite3_keyword_check",
"_sqlite3_keyword_count",
"_sqlite3_keyword_name",
"_sqlite3_last_insert_rowid",
"_sqlite3_libversion",
"_sqlite3_libversion_number",
"_sqlite3_limit",
"_sqlite3_log",
"_sqlite3_malloc",
"_sqlite3_malloc64",
"_sqlite3_memory_highwater",
"_sqlite3_memory_used",
"_sqlite3_mprintf",
"_sqlite3_msize",
"_sqlite3_next_stmt",
"_sqlite3_open",
"_sqlite3_open16",
"_sqlite3_open_v2",
"_sqlite3_os_end",
"_sqlite3_os_init",
"_sqlite3_overload_function",
"_sqlite3_prepare",
"_sqlite3_prepare16",
"_sqlite3_prepare16_v2",
"_sqlite3_prepare16_v3",
"_sqlite3_prepare_v2",
"_sqlite3_prepare_v3",
"_sqlite3_progress_handler",
"_sqlite3_randomness",
"_sqlite3_realloc",
"_sqlite3_realloc64",
"_sqlite3_release_memory",
"_sqlite3_reset",
"_sqlite3_sql",
"_sqlite3_step",
"_sqlite3_reset_auto_extension",
"_sqlite3_result_blob",
"_sqlite3_result_blob64",
"_sqlite3_result_double",
"_sqlite3_result_error",
"_sqlite3_result_error16",
"_sqlite3_result_error_code",
"_sqlite3_result_error_nomem",
"_sqlite3_result_error_toobig",
"_sqlite3_result_int",
"_sqlite3_result_int64",
"_sqlite3_result_null",
"_sqlite3_result_pointer",
"_sqlite3_result_subtype",
"_sqlite3_result_text",
"_sqlite3_result_text16",
"_sqlite3_result_text16be",
"_sqlite3_result_text16le",
"_sqlite3_result_text64",
"_sqlite3_result_value",
"_sqlite3_result_zeroblob",
"_sqlite3_result_zeroblob64",
"_sqlite3_rollback_hook",
"_sqlite3_serialize",
"_sqlite3_set_authorizer",
"_sqlite3_set_auxdata",
"_sqlite3_set_clientdata",
"_sqlite3_set_last_insert_rowid",
"_sqlite3_shutdown",
"_sqlite3_sleep",
"_sqlite3_snprintf",
"_sqlite3_soft_heap_limit64",
"_sqlite3_sourceid",
"_sqlite3_sql",
"_sqlite3_status",
"_sqlite3_status64",
"_sqlite3_step",
"_sqlite3_stmt_busy",
"_sqlite3_stmt_explain",
"_sqlite3_stmt_isexplain",
"_sqlite3_stmt_readonly",
"_sqlite3_stmt_status",
"_sqlite3_str_append",
"_sqlite3_str_appendall",
"_sqlite3_str_appendchar",
"_sqlite3_str_appendf",
"_sqlite3_str_errcode",
"_sqlite3_str_finish",
"_sqlite3_str_length",
"_sqlite3_str_new",
"_sqlite3_str_reset",
"_sqlite3_str_value",
"_sqlite3_str_vappendf",
"_sqlite3_strglob",
"_sqlite3_stricmp",
"_sqlite3_strlike",
"_sqlite3_strnicmp",
"_sqlite3_system_errno",
"_sqlite3_table_column_metadata",
"_sqlite3_test_control",
"_sqlite3_threadsafe",
"_sqlite3_total_changes",
"_sqlite3_total_changes64",
"_sqlite3_trace_v2",
"_sqlite3_txn_state",
"_sqlite3_update_hook",
"_sqlite3_uri_boolean",
"_sqlite3_uri_int64",
"_sqlite3_uri_key",
"_sqlite3_uri_parameter",
"_sqlite3_user_data",
"_sqlite3_value_blob",
"_sqlite3_value_bytes",
"_sqlite3_value_bytes16",
"_sqlite3_value_double",
"_sqlite3_value_dup",
"_sqlite3_value_encoding",
"_sqlite3_value_free",
"_sqlite3_value_frombind",
"_sqlite3_value_int",
"_sqlite3_value_int64",
"_sqlite3_value_nochange",
"_sqlite3_value_numeric_type",
"_sqlite3_value_pointer",
"_sqlite3_value_subtype",
"_sqlite3_value_text",
"_sqlite3_value_text16",
"_sqlite3_value_text16be",
"_sqlite3_value_text16le",
"_sqlite3_value_type",
"_sqlite3_vfs_find"
"_sqlite3_version",
"_sqlite3_vfs_find",
"_sqlite3_vfs_register",
"_sqlite3_vfs_unregister",
"_sqlite3_vmprintf",
"_sqlite3_vsnprintf",
"_sqlite3_vtab_collation",
"_sqlite3_vtab_config",
"_sqlite3_vtab_distinct",
"_sqlite3_vtab_in",
"_sqlite3_vtab_in_first",
"_sqlite3_vtab_in_next",
"_sqlite3_vtab_nochange",
"_sqlite3_vtab_on_conflict",
"_sqlite3_vtab_rhs_value",
"_sqlite3_wal_autocheckpoint",
"_sqlite3_wal_checkpoint",
"_sqlite3_wal_checkpoint_v2",
"_sqlite3_wal_hook"
]
13 changes: 11 additions & 2 deletions src/extra_exported_runtime_methods.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
[
"addFunction",
"ccall",
"cwrap",
"getTempRet0",
"getValue",
"setValue",
"UTF8ToString",
"lengthBytesUTF8",
"stringToUTF8",
"lengthBytesUTF8"
"stringToUTF16",
"stringToUTF32",
"AsciiToString",
"UTF8ToString",
"UTF16ToString",
"UTF32ToString",
"intArrayFromString",
"intArrayToString",
"writeArrayToMemory"
]
5 changes: 4 additions & 1 deletion src/libvfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ const vfs_methods = {
$vfs_method_support__postset: 'vfs_method_support();',
$vfs_method_support: function() {
const hasAsyncify = typeof Asyncify === 'object';
if (hasAsyncify) {
Module['handleAsync'] = Asyncify.handleAsync;
}

const mapIdToVFS = new Map();
const mapFileToVFS = new Map();

Module['registerVFS'] = function(vfs, makeDefault) {
const vfsAlreadyRegistered = ccall('sqlite3_vfs_find', 'number', ['string'],
[vfs.name]);
Expand Down

0 comments on commit 4aa5a32

Please sign in to comment.