]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Further docs and minor cleanups in the JS virtual table helper.
authorstephan <stephan@noemail.net>
Thu, 8 Dec 2022 18:18:37 +0000 (18:18 +0000)
committerstephan <stephan@noemail.net>
Thu, 8 Dec 2022 18:18:37 +0000 (18:18 +0000)
FossilOrigin-Name: c31e7488ac1a6b957782b72bd026b1f0590637b631e44a1fdf1dedeb5c587819

ext/wasm/api/sqlite3-v-helper.js
manifest
manifest.uuid

index a28fb389a3de1ae5c7a8dfc699bd7ba9992f830b..25f71556a6cd1f4f2e8dbe7affd192c81bc3dcc3 100644 (file)
@@ -327,13 +327,19 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
   };
 
   /**
-     Internal helper for implementing xVtab and xCursor.
-     The first argument must be the logical name of the
-     handler ('xVtab' or 'xCursor') and the second must be
-     the capi.XYZ struct-type value, e.g. capi.sqlite3_vtab
-     or capi.sqlite3_vtab_cursor.
+     A factory function which implements a simple lifetime manager for
+     mappings between C struct pointers and their JS-level wrappers.
+     The first argument must be the logical name of the manager
+     (e.g. 'xVtab' or 'xCursor'), which is only used for error
+     reporting. The second must be the capi.XYZ struct-type value,
+     e.g. capi.sqlite3_vtab or capi.sqlite3_vtab_cursor.
+
+     Returns an object with 4 methods: create(), get(), unget(), and
+     dispose(), plus a StructType member with the value of the 2nd
+     argument. The methods are documented in the body of this
+     function.
   */
-  const __xLifetimeManager = function(name, StructType){
+  const StructPtrMapper = function(name, StructType){
     const __xWrap = __xWrapFactory(name,StructType);
     /**
        This object houses a small API for managing mappings of (`T*`)
@@ -406,18 +412,18 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
      instances in sqlite3_module methods to capi.sqlite3_vtab
      objects.
 
-     The API docs are in the API-internal __xLifetimeManager().
+     The API docs are in the API-internal StructPtrMapper().
   */
-  vt.xVtab = __xLifetimeManager('xVtab', capi.sqlite3_vtab);
+  vt.xVtab = StructPtrMapper('xVtab', capi.sqlite3_vtab);
 
   /**
      A lifetime-management object for mapping `sqlite3_vtab_cursor*`
      instances in sqlite3_module methods to capi.sqlite3_vtab_cursor
      objects.
 
-     The API docs are in the API-internal __xLifetimeManager().
+     The API docs are in the API-internal StructPtrMapper().
   */
-  vt.xCursor = __xLifetimeManager('xCursor', capi.sqlite3_vtab_cursor);
+  vt.xCursor = StructPtrMapper('xCursor', capi.sqlite3_vtab_cursor);
 
   /**
      Convenience form of creating an sqlite3_index_info wrapper,
index eb27511aeb4001bc116f8d2335eacf12ec08a209..6cc38aedce0cb0bbc6631225f354608c2dc3f0bb 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Ease-of-use/legibility\simprovements\sin\sthe\svirtual\stable\sJS\shelpers.
-D 2022-12-08T17:07:27.475
+C Further\sdocs\sand\sminor\scleanups\sin\sthe\sJS\svirtual\stable\shelper.
+D 2022-12-08T18:18:37.994
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -509,7 +509,7 @@ F ext/wasm/api/sqlite3-api-prologue.js 1380e933325c11786b2afc93fc8ff88c2fd1ffeac
 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
-F ext/wasm/api/sqlite3-v-helper.js d0d647110f8595d26836951cfc5a47f15282f20e72584decc0b00e2a3f0d169c
+F ext/wasm/api/sqlite3-v-helper.js 3f0ef738f5c44943f05ec5bd86976d617e8ae229a0127a1efe81bbb4763293a7
 F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 8ec510fee735c646fb18a3b99f0ca5ca461f9e066c43cdc404d7144f12ae6ed6
 F ext/wasm/api/sqlite3-wasi.h 25356084cfe0d40458a902afb465df8c21fc4152c1d0a59b563a3fba59a068f9
 F ext/wasm/api/sqlite3-wasm.c 97034ab4f40ec1fac71ccfaf3afffdca6b1ea2dcd95b7871527bad0f34e152b0
@@ -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 a1454744c770a30a32a6d7b7fc59ef7be48cf67348b238540592850d7c2c7757
-R 17cb094a6db22f136920052decf90bf5
+P 54c7ad7e08bdb87579398ade366605bfa2e2538a94aabcc6e4cda8e173649760
+R 4c50a667470c9bbb57a953933f0b79e2
 U stephan
-Z fce05bcff7bc40d31cdbdf756e15ecfc
+Z df7927342245d4323b165b2786a2dc10
 # Remove this line to create a well-formed Fossil manifest.
index 83cd9546390252607cb36c194fe994d48b8b5eea..980af730ddb63a64c6a823cc82573290990fe118 100644 (file)
@@ -1 +1 @@
-54c7ad7e08bdb87579398ade366605bfa2e2538a94aabcc6e4cda8e173649760
\ No newline at end of file
+c31e7488ac1a6b957782b72bd026b1f0590637b631e44a1fdf1dedeb5c587819
\ No newline at end of file