aboutsummaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/wasm/GNUmakefile3
-rw-r--r--ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras31
-rw-r--r--ext/wasm/api/sqlite3-api-glue.c-pp.js8
-rw-r--r--ext/wasm/api/sqlite3-wasm.c5
-rw-r--r--ext/wasm/tester1.c-pp.js14
5 files changed, 43 insertions, 18 deletions
diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile
index 28387872f..bf1a49111 100644
--- a/ext/wasm/GNUmakefile
+++ b/ext/wasm/GNUmakefile
@@ -260,7 +260,8 @@ SQLITE_OPT.full-featured := \
-DSQLITE_ENABLE_RTREE \
-DSQLITE_ENABLE_SESSION \
-DSQLITE_ENABLE_STMTVTAB \
- -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+ -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION \
+ -DSQLITE_ENABLE_COLUMN_METADATA
ifeq (0,$(wasm-bare-bones))
# The so-called canonical build is full-featured:
diff --git a/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras b/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras
index e635d93b3..01dad072e 100644
--- a/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras
+++ b/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras
@@ -1,12 +1,27 @@
+_sqlite3_column_database_name
+_sqlite3_column_origin_name
+_sqlite3_column_table_name
+_sqlite3_create_module
+_sqlite3_create_module_v2
_sqlite3_create_window_function
-_sqlite3_progress_handler
-_sqlite3_set_authorizer
+_sqlite3_declare_vtab
+_sqlite3_drop_modules
_sqlite3_preupdate_blobwrite
_sqlite3_preupdate_count
_sqlite3_preupdate_depth
_sqlite3_preupdate_hook
_sqlite3_preupdate_new
_sqlite3_preupdate_old
+_sqlite3_progress_handler
+_sqlite3_set_authorizer
+_sqlite3_vtab_collation
+_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
_sqlite3changegroup_add
_sqlite3changegroup_add_strm
_sqlite3changegroup_delete
@@ -49,15 +64,3 @@ _sqlite3session_object_config
_sqlite3session_patchset
_sqlite3session_patchset_strm
_sqlite3session_table_filter
-_sqlite3_create_module
-_sqlite3_create_module_v2
-_sqlite3_declare_vtab
-_sqlite3_drop_modules
-_sqlite3_vtab_collation
-_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
diff --git a/ext/wasm/api/sqlite3-api-glue.c-pp.js b/ext/wasm/api/sqlite3-api-glue.c-pp.js
index a38b9cb5e..553911018 100644
--- a/ext/wasm/api/sqlite3-api-glue.c-pp.js
+++ b/ext/wasm/api/sqlite3-api-glue.c-pp.js
@@ -368,6 +368,14 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
);
}/* sqlite3_set_authorizer() */
+ if( !!wasm.exports.sqlite3_column_origin_name ){
+ wasm.bindingSignatures.push(
+ ["sqlite3_column_database_name","string", "sqlite3_stmt*", "int"],
+ ["sqlite3_column_origin_name","string", "sqlite3_stmt*", "int"],
+ ["sqlite3_column_table_name","string", "sqlite3_stmt*", "int"]
+ );
+ }
+
if(false && wasm.compileOptionUsed('SQLITE_ENABLE_NORMALIZE')){
/* ^^^ "the problem" is that this is an optional feature and the
build-time function-export list does not currently take
diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c
index 1850d313c..ee8a10209 100644
--- a/ext/wasm/api/sqlite3-wasm.c
+++ b/ext/wasm/api/sqlite3-wasm.c
@@ -135,9 +135,12 @@
/*
** If SQLITE_WASM_BARE_BONES is defined, undefine most of the ENABLE
-** macros.
+** macros. This will, when using the canonical makefile, also elide
+** any C functions from the WASM exports which are listed in
+** ./EXPORT_FUNCTIONS.sqlite3-extras.
*/
#ifdef SQLITE_WASM_BARE_BONES
+# undef SQLITE_ENABLE_COLUMN_METADATA
# undef SQLITE_ENABLE_DBPAGE_VTAB
# undef SQLITE_ENABLE_DBSTAT_VTAB
# undef SQLITE_ENABLE_EXPLAIN_COMMENTS
diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js
index d30e59e38..2fe0c2377 100644
--- a/ext/wasm/tester1.c-pp.js
+++ b/ext/wasm/tester1.c-pp.js
@@ -3302,7 +3302,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
.assert(true === await u3.removeVfs())
.assert(false === await P3b.removeVfs());
}
- }/*OPFS SAH Pool sanity checks*/)
+ }/*OPFS SAH Pool sanity checks*/);
////////////////////////////////////////////////////////////////////////
T.g('Misc. APIs')
@@ -3353,6 +3353,16 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
T.assert( 1===n )
.assert( 0===capi.sqlite3_stmt_busy(stmt) )
.assert( !stmt.isBusy() );
+
+ if( wasm.exports.sqlite3_column_origin_name ){
+ log("Column metadata APIs enabled");
+ T.assert( "t" === capi.sqlite3_column_table_name(stmt, 0))
+ .assert("a" === capi.sqlite3_column_origin_name(stmt, 0))
+ .assert("main" === capi.sqlite3_column_database_name(stmt, 0))
+ }else{
+ log("Column metadata APIs not enabled");
+ } // column metadata APIs
+
stmt.finalize();
db.close();
})
@@ -3364,7 +3374,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
capi.sqlite3_interrupt(db);
T.assert( 0!==capi.sqlite3_is_interrupted(db) );
db.close();
- })
+ });
////////////////////////////////////////////////////////////////////////
T.g('Bug Reports')