aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-glue.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-12-09 02:12:43 +0000
committerstephan <stephan@noemail.net>2022-12-09 02:12:43 +0000
commit735dd03377d600df21235e3bbc35a19275effda3 (patch)
tree913765eef1a3410d1d5ad87a46612bfb6530c26a /ext/wasm/api/sqlite3-api-glue.js
parent6ca03e14e90070a80e2e53fd98a53d1eecc8c5bb (diff)
downloadsqlite-735dd03377d600df21235e3bbc35a19275effda3.tar.gz
sqlite-735dd03377d600df21235e3bbc35a19275effda3.zip
Expose sqlite3_table_column_metadata() to wasm.
FossilOrigin-Name: c31eb509e5cb1025de058132ee9a45d70c84ee47a6abe18811a65ce339f062a0
Diffstat (limited to 'ext/wasm/api/sqlite3-api-glue.js')
-rw-r--r--ext/wasm/api/sqlite3-api-glue.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/ext/wasm/api/sqlite3-api-glue.js b/ext/wasm/api/sqlite3-api-glue.js
index 2e78df348..587d72c67 100644
--- a/ext/wasm/api/sqlite3-api-glue.js
+++ b/ext/wasm/api/sqlite3-api-glue.js
@@ -80,9 +80,9 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
/**
Add some descriptive xWrap() aliases for '*' intended to (A)
initially improve readability/correctness of capi.signatures
- and (B) eventually perhaps provide automatic conversion from
- higher-level representations, e.g. capi.sqlite3_vfs to
- `sqlite3_vfs*` via capi.sqlite3_vfs.pointer.
+ and (B) provide automatic conversion from higher-level
+ representations, e.g. capi.sqlite3_vfs to `sqlite3_vfs*` via
+ capi.sqlite3_vfs.pointer.
*/
const aPtr = wasm.xWrap.argAdapter('*');
const nilType = function(){};
@@ -116,14 +116,16 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
return capi.sqlite3_vfs_find(v)
|| sqlite3.SQLite3Error.toss("Unknown sqlite3_vfs name:",v);
}
- return aPtr((v instanceof capi.sqlite3_vfs) ? v.pointer : v);
+ return aPtr((v instanceof (capi.sqlite3_vfs || nilType))
+ ? v.pointer : v);
});
- wasm.xWrap.resultAdapter('sqlite3*', aPtr)
- ('sqlite3_context*', aPtr)
- ('sqlite3_stmt*', aPtr)
- ('sqlite3_vfs*', aPtr)
- ('void*', aPtr);
+ const rPtr = wasm.xWrap.resultAdapter('*');
+ wasm.xWrap.resultAdapter('sqlite3*', rPtr)
+ ('sqlite3_context*', rPtr)
+ ('sqlite3_stmt*', rPtr)
+ ('sqlite3_vfs*', rPtr)
+ ('void*', rPtr);
/**
Populate api object with sqlite3_...() by binding the "raw" wasm