Expose sqlite3_table_column_metadata() to wasm.
FossilOrigin-Name: c31eb509e5cb1025de058132ee9a45d70c84ee47a6abe18811a65ce339f062a0
This commit is contained in:
parent
6ca03e14e9
commit
735dd03377
@ -92,6 +92,7 @@ _sqlite3_strglob
|
||||
_sqlite3_stricmp
|
||||
_sqlite3_strlike
|
||||
_sqlite3_strnicmp
|
||||
_sqlite3_table_column_metadata
|
||||
_sqlite3_total_changes
|
||||
_sqlite3_total_changes64
|
||||
_sqlite3_trace_v2
|
||||
|
@ -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
|
||||
|
@ -1004,11 +1004,14 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
|
||||
["sqlite3_stricmp", "int", "string", "string"],
|
||||
["sqlite3_strlike", "int", "string", "string","int"],
|
||||
["sqlite3_strnicmp", "int", "string", "string", "int"],
|
||||
["sqlite3_trace_v2", "int", "sqlite3*", "int", "*", "*"],
|
||||
["sqlite3_table_column_metadata", "int",
|
||||
"sqlite3*", "string", "string", "string",
|
||||
"**", "**", "*", "*", "*"],
|
||||
["sqlite3_total_changes", "int", "sqlite3*"],
|
||||
/* Note sqlite3_uri_...() has very specific requirements
|
||||
for their first C-string arguments, so we cannot perform
|
||||
any type conversion on those. */
|
||||
["sqlite3_trace_v2", "int", "sqlite3*", "int", "*", "*"],
|
||||
/* Note that sqlite3_uri_...() have very specific requirements for
|
||||
their first C-string arguments, so we cannot perform any value
|
||||
conversion on those. */
|
||||
["sqlite3_uri_boolean", "int", "sqlite3_filename", "string", "int"],
|
||||
["sqlite3_uri_key", "string", "sqlite3_filename", "int"],
|
||||
["sqlite3_uri_parameter", "string", "sqlite3_filename", "string"],
|
||||
|
@ -1265,6 +1265,27 @@ self.sqlite3InitModule = sqlite3InitModule;
|
||||
}
|
||||
})
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
.t("sqlite3_table_column_metadata()", function(sqlite3){
|
||||
const stack = wasm.pstack.pointer;
|
||||
try{
|
||||
const [pzDT, pzColl, pNotNull, pPK, pAuto] =
|
||||
wasm.pstack.allocPtr(5);
|
||||
const rc = capi.sqlite3_table_column_metadata(
|
||||
this.db, "main", "t", "rowid",
|
||||
pzDT, pzColl, pNotNull, pPK, pAuto
|
||||
);
|
||||
T.assert(0===rc)
|
||||
.assert("INTEGER"===wasm.cstrToJs(wasm.getPtrValue(pzDT)))
|
||||
.assert("BINARY"===wasm.cstrToJs(wasm.getPtrValue(pzColl)))
|
||||
.assert(0===wasm.getMemValue(pNotNull,'i32'))
|
||||
.assert(1===wasm.getMemValue(pPK,'i32'))
|
||||
.assert(0===wasm.getMemValue(pAuto,'i32'))
|
||||
}finally{
|
||||
wasm.pstack.restore(stack);
|
||||
}
|
||||
})
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
.t('selectArray/Object()', function(sqlite3){
|
||||
const db = this.db;
|
||||
@ -1710,7 +1731,9 @@ self.sqlite3InitModule = sqlite3InitModule;
|
||||
The vtab demonstrated here is a JS-ification of
|
||||
ext/misc/templatevtab.c.
|
||||
*/
|
||||
const tmplMod = (new sqlite3.capi.sqlite3_module()).setupModule({
|
||||
const tmplMod = new sqlite3.capi.sqlite3_module();
|
||||
T.assert(0===tmplMod.$xUpdate);
|
||||
tmplMod.setupModule({
|
||||
catchExceptions: false,
|
||||
methods: {
|
||||
xConnect: function(pDb, pAux, argc, argv, ppVtab, pzErr){
|
||||
@ -1873,7 +1896,8 @@ self.sqlite3InitModule = sqlite3InitModule;
|
||||
}
|
||||
});
|
||||
this.db.onclose.disposeAfter.push(tmplMod);
|
||||
T.assert(tmplMod.$xCreate)
|
||||
T.assert(0===tmplMod.$xUpdate)
|
||||
.assert(tmplMod.$xCreate)
|
||||
.assert(tmplMod.$xCreate === tmplMod.$xConnect,
|
||||
"setup() must make these equivalent and "+
|
||||
"installMethods() must avoid re-compiling identical functions");
|
||||
|
18
manifest
18
manifest
@ -1,5 +1,5 @@
|
||||
C Expose\ssqlite3_db_status()\sand\ssqlite3_db_config()\sto\swasm,\snoting\sthat\sthe\slatter\srequires\sseveral\sinternal\swrappers\sto\saccount\sfor\sthe\svarious\svaridic\sforms\s(C\svarargs\scannot\sbe\sbound\sto\swasm).
|
||||
D 2022-12-09T01:49:17.464
|
||||
C Expose\ssqlite3_table_column_metadata()\sto\swasm.
|
||||
D 2022-12-09T02:12:43.224
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -494,7 +494,7 @@ F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34ce
|
||||
F ext/wasm/GNUmakefile 54c0db93a5493f625c0a993c12aee5d83951440eee03b2aecfc8aeb998182998
|
||||
F ext/wasm/README-dist.txt 2d670b426fc7c613b90a7d2f2b05b433088fe65181abead970980f0a4a75ea20
|
||||
F ext/wasm/README.md ef39861aa21632fdbca0bdd469f78f0096f6449a720f3f39642594af503030e9
|
||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api 454a421ba99164c0d1e4d4778a1d59a22a786e31d59115ad9ecb31669bd2625d
|
||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api 914cbaa9fad42d4ebe33d0ea6c0151d043e6c0237782f2d27eb5e35f54b7c604
|
||||
F ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api 1ec3c73e7d66e95529c3c64ac3de2470b0e9e7fbf7a5b41261c367cf4f1b7287
|
||||
F ext/wasm/api/README.md 17fb1e10335cc87e366dec496c5b17b061f3f75cdf216e825258de34d97a3e53
|
||||
F ext/wasm/api/extern-post-js.c-pp.js 8923f76c3d2213159e12d641dc750523ead5c848185dc4996fae5cc12397f88d
|
||||
@ -503,9 +503,9 @@ F ext/wasm/api/post-js-footer.js cd0a8ec768501d9bd45d325ab0442037fb0e33d1f3b4f08
|
||||
F ext/wasm/api/post-js-header.js 47b6b281f39ad59fa6e8b658308cd98ea292c286a68407b35ff3ed9cfd281a62
|
||||
F ext/wasm/api/pre-js.c-pp.js b88499dc303c21fc3f55f2c364a0f814f587b60a95784303881169f9e91c1d5f
|
||||
F ext/wasm/api/sqlite3-api-cleanup.js 680d5ccfff54459db136a49b2199d9f879c8405d9c99af1dda0cc5e7c29056f4
|
||||
F ext/wasm/api/sqlite3-api-glue.js f4b3a04200a694312ff6e944b0d22c5b1833341da39ce0a83370d4be379fca7a
|
||||
F ext/wasm/api/sqlite3-api-glue.js 58efb4f513d9a75bbf1c9f81944047df78c61bd7d5ad8b64f92fa9582bca37bf
|
||||
F ext/wasm/api/sqlite3-api-oo1.js e9e6da5f9e4d7d309fe4c338a22fb38575e831cddd10d6506fba7ddc180df6e6
|
||||
F ext/wasm/api/sqlite3-api-prologue.js b603821ec13c1f2c61d50e8d451d031dee03b1d8bd4822a831b14959049e0de8
|
||||
F ext/wasm/api/sqlite3-api-prologue.js c0411213b696301ba19ee11cf8fea7876c883e7399332ea79d5768cd4121bf13
|
||||
F ext/wasm/api/sqlite3-api-worker1.js e94ba98e44afccfa482874cd9acb325883ade50ed1f9f9526beb9de1711f182f
|
||||
F ext/wasm/api/sqlite3-license-version-header.js a661182fc93fc2cf212dfd0b987f8e138a3ac98f850b1112e29b5fbdaecc87c3
|
||||
F ext/wasm/api/sqlite3-opfs-async-proxy.js 7795b84b66a7a8dedc791340709b310bb497c3c72a80bef364fa2a58e2ddae3f
|
||||
@ -555,7 +555,7 @@ F ext/wasm/test-opfs-vfs.html 1f2d672f3f3fce810dfd48a8d56914aba22e45c6834e262555
|
||||
F ext/wasm/test-opfs-vfs.js 44363db07b2a20e73b0eb1808de4400ca71b703af718d0fa6d962f15e73bf2ac
|
||||
F ext/wasm/tester1-worker.html d43f3c131d88f10d00aff3e328fed13c858d674ea2ff1ff90225506137f85aa9
|
||||
F ext/wasm/tester1.c-pp.html d34bef3d48e5cbc1c7c06882ad240fec49bf88f5f65696cc2c72c416933aa406
|
||||
F ext/wasm/tester1.c-pp.js 187c7da47ea74ece38226138cebbc62fdad7fe405e0669ed5a1d572e68b8992b
|
||||
F ext/wasm/tester1.c-pp.js 7eebd39ac7603645d501a550387122230a283a0b0ac111497e3221a4505bcdab
|
||||
F ext/wasm/tests/opfs/concurrency/index.html 86d8ac435074d1e7007b91105f4897f368c165e8cecb6a9aa3d81f5cf5dcbe70
|
||||
F ext/wasm/tests/opfs/concurrency/test.js a98016113eaf71e81ddbf71655aa29b0fed9a8b79a3cdd3620d1658eb1cc9a5d
|
||||
F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2
|
||||
@ -2067,8 +2067,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 1c2dda177a11fcc5b66e5554507c23ba4b9948a710b3bccfb26963b9851d40a4
|
||||
R e63e150c49d1be6488417c0c1dafd2a0
|
||||
P d5753668915c1db204fa80153614653243081ffaddea22f26ad59bb1836948b9
|
||||
R 739ea8b3ac4045dd84659edd33542511
|
||||
U stephan
|
||||
Z ddcdedc140c2db0b3c3d65ae7d339a90
|
||||
Z 266a78087ef6b67b6598f56aee51656a
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@ -1 +1 @@
|
||||
d5753668915c1db204fa80153614653243081ffaddea22f26ad59bb1836948b9
|
||||
c31eb509e5cb1025de058132ee9a45d70c84ee47a6abe18811a65ce339f062a0
|
Loading…
Reference in New Issue
Block a user