]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Factor out some now-superfluous JS-side kvvfs code. Factor out a superfluous allocati...
authorstephan <stephan@noemail.net>
Tue, 25 Nov 2025 04:07:50 +0000 (04:07 +0000)
committerstephan <stephan@noemail.net>
Tue, 25 Nov 2025 04:07:50 +0000 (04:07 +0000)
FossilOrigin-Name: be435b668f1aee56fc4965592c207de25283de238fe89002f1a68ba0567aca65

ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js
ext/wasm/api/sqlite3-wasm.c
ext/wasm/tester1.c-pp.js
manifest
manifest.uuid

index cc64f1b588ae30a564a3b43b7bd3a9244b43e484..003844aeedf7684b2688d90657fec0193ae6810b 100644 (file)
@@ -97,6 +97,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
 
   const util = sqlite3.util,
         wasm = sqlite3.wasm,
+        toss3 = util.toss3,
         hop = (o,k)=>Object.prototype.hasOwnProperty.call(o,k);
 
   const cache = Object.assign(Object.create(null),{
@@ -283,66 +284,6 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
         ? cache.storagePool[zClass]
         : cache.storagePool[wasm.cstrToJs(zClass)];
 
-  /**
-     Internal helper for sqlite3_js_kvvfs_clear() and friends.  Its
-     argument should be one of ('local','session',"") or the name of
-     an opened transient kvvfs db.
-
-     Its handling of which=='' is historical: it means to consider
-     both local and session storage. which=='' is also a valid kvvfs
-     storage unit name, though. Prior to that possibility, this API
-     was only availbe in the main UI thread, so the empty string
-     continues to unconditionally work that way in the main UI
-     thread. When, however, it's running where local/session storage
-     are not availble, it treats which=='' as a storage unit name.
-
-     It returns an object in the form:
-
-     .prefix = the key prefix for this storage. Typically
-     ("kvvfs-"+which) for local/sessionStorage and "" for transient
-     storage. (The former is historical, retained for backwards
-     compatibility.) If `which` is falsy then the prefix is "kvvfs-"
-     for backwards compatibility (it will match keys for both local-
-     and sessionStorage, but not transient storage or non-kvvfs keys
-     in the persistent storages).
-
-     .stores = [ array of Storage-like objects ]. Will only have >1
-     element if which is falsy, in which case it contains (if called
-     from the main thread) localStorage and sessionStorage. It will be
-     empty if no mapping is found or those objects are not available
-     in the current environment (e.g. a worker thread).
-
-     .cts = the underlying storagePool entry. This will only be set
-     if which is not empty.
-  */
-  const kvvfsWhich = function callee(which){
-    const rc = Object.assign(Object.create(null),{
-      stores: []
-    });
-    if( which || !globalThis.Storage ){
-      const s = storageForZClass(which);
-      if( s ){
-        //debug("kvvfsWhich",s.jzClass,rc.prefix, s.s);
-        rc.prefix = s.keyPrefix ?? '';
-        rc.stores.push(s.storage);
-        rc.cts = s;
-      }else{
-        rc.prefix = undefined;
-      }
-    }else{
-      rc.prefix = 'kvvfs-';
-      // Legacy behavior: return both local and session storage.
-      if( cache.storagePool.local ) {
-        rc.stores.push(cache.storagePool.local.storage);
-      }
-      if( cache.storagePool.session ) {
-        rc.stores.push(cache.storagePool.session.storage);
-      }
-    }
-    //debug("kvvfsWhich",which,rc);
-    return rc;
-  };
-
 //#if nope
   // fileForDb() works but we don't have a current need for it.
   /**
@@ -388,11 +329,11 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
   };
 //#endif nope
 
-  /** pstack-allocates a key. Caller must eventually restore
-      the pstack to free the memory. */
-  const keyForStorage = (store, zClass, zKey)=>{
-    //debug("keyForStorage(",store, wasm.cstrToJs(zClass), wasm.cstrToJs(zKey));
-    return wasm.exports.sqlite3__wasm_kvvfsMakeKeyOnPstack(
+  /** Returns a C string from sqlite3__wasm_kvvfsMakeKey(). The memory
+      is static, so must be copied before a second call. */
+  const zKeyForStorage = (store, zClass, zKey)=>{
+    //debug("zKeyForStorage(",store, wasm.cstrToJs(zClass), wasm.cstrToJs(zKey));
+    return wasm.exports.sqlite3__wasm_kvvfsMakeKey(
       store.keyPrefix ? zClass : wasm.ptr.null, zKey
     );
   };
@@ -474,7 +415,6 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
       */
       recordHandler: {
         xRcrdRead: (zClass, zKey, zBuf, nBuf)=>{
-          const stack = pstack.pointer /* keyForStorage() allocs from here */;
           try{
             const jzClass = wasm.cstrToJs(zClass);
             const store = storageForZClass(jzClass);
@@ -483,7 +423,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
                     zBuf, nBuf, store );
             }
             if( !store ) return -1;
-            const zXKey = keyForStorage(store, zClass, zKey);
+            const zXKey = zKeyForStorage(store, zClass, zKey);
             if(!zXKey) return -3/*OOM*/;
             const jXKey = wasm.cstrToJs(zXKey);
             //debug("xRcrdRead zXKey", jzClass, wasm.cstrToJs(zXKey), store );
@@ -501,10 +441,10 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
               return nV;
             }
             if( nBuf+1<nV ){
-              util.toss3(capi.SQLITE_RANGE,
-                         "xRcrdRead()",jzClass,jXKey,
-                         "input buffer is too small: need",
-                         nV,"but have",nBuf);
+              toss3(capi.SQLITE_RANGE,
+                    "xRcrdRead()",jzClass,jXKey,
+                    "input buffer is too small: need",
+                    nV,"but have",nBuf);
             }
             if( 0 ){
               debug("xRcrdRead", nBuf, zClass, wasm.cstrToJs(zClass),
@@ -531,19 +471,16 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
             heap[wasm.ptr.add(zBuf, nV)] = 0;
             return nBuf;
           }catch(e){
-            error("kvrecordRead()",e);
+            cache.setError(e);
             return -2;
-          }finally{
-            pstack.restore(stack);
           }
         },
 
         xRcrdWrite: (zClass, zKey, zData)=>{
-          const stack = pstack.pointer /* keyForStorage() allocs from here */;
           try {
             const jzClass = wasm.cstrToJs(zClass);
             const store = storageForZClass(jzClass);
-            const zXKey = keyForStorage(store, zClass, zKey);
+            const zXKey = zKeyForStorage(store, zClass, zKey);
             if(!zXKey) return SQLITE_NOMEM;
             store.storage.setItem(
               wasm.cstrToJs(zXKey),
@@ -553,24 +490,19 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
           }catch(e){
             error("kvrecordWrite()",e);
             return capi.SQLITE_IOERR;
-          }finally{
-            pstack.restore(stack);
           }
         },
 
         xRcrdDelete: (zClass, zKey)=>{
-          const stack = pstack.pointer /* keyForStorage() allocs from here */;
           try {
             const store = storageForZClass(zClass);
-            const zXKey = keyForStorage(store, zClass, zKey);
+            const zXKey = zKeyForStorage(store, zClass, zKey);
             if(!zXKey) return capi.SQLITE_NOMEM;
             store.storage.removeItem(wasm.cstrToJs(zXKey));
             return 0;
           }catch(e){
             error("kvrecordDelete()",e);
             return capi.SQLITE_IOERR;
-          }finally{
-            pstack.restore(stack);
           }
         }
       }/*recordHandler*/,
@@ -591,19 +523,19 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
             }
             const n = wasm.cstrlen(zName);
             if( !n ){
-              util.toss3(capi.SQLITE_RANGE,
-                         "Storage name may not be empty (backwards",
-                         "compatibilty constraint)");
+              toss3(capi.SQLITE_RANGE,
+                    "Storage name may not be empty (backwards",
+                    "compatibilty constraint)");
             }else if( n > kvvfsMethods.$nKeySize - 8 /*"-journal"*/ - 1 ){
-              util.toss3(capi.SQLITE_RANGE,
-                         "Storage name is too long:", wasm.cstrToJs(zName));
+              toss3(capi.SQLITE_RANGE,
+                    "Storage name is too long:", wasm.cstrToJs(zName));
             }
             let i = 0;
             for( ; i < n; ++i ){
               const ch = wasm.peek8(wasm.ptr.add(zName, i));
               if( ch < 45 || (ch & 0x80) ){
-                util.toss3(capi.SQLITE_RANGE,
-                           "Illegal character ("+ch+"d) in storage name.");
+                toss3(capi.SQLITE_RANGE,
+                      "Illegal character ("+ch+"d) in storage name.");
               }
             }
             const jzClass = wasm.cstrToJs(zName);
@@ -611,8 +543,8 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
                           | capi.SQLITE_OPEN_TEMP_DB
                           | capi.SQLITE_OPEN_TRANSIENT_DB))
                 && cache.rxJournalSuffix.test(jzClass) ){
-              util.toss3(capi.SQLITE_ERROR,
-                         "DB files may not have a '-journal' suffix.");
+              toss3(capi.SQLITE_ERROR,
+                    "DB files may not have a '-journal' suffix.");
             }
             const rc = originalMethods.vfs.xOpen(pProtoVfs, zName, pProtoFile,
                                                  flags, pOutFlags);
@@ -897,6 +829,11 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
     }
   }/*native method overrides*/
 
+  /*
+    That gets all of the low-level bits out of the way. What follows
+    are the public API additions.
+  */
+
   /**
      Clears all storage used by the kvvfs DB backend, deleting any
      DB(s) stored there.
@@ -935,33 +872,37 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
      - It accepts an arbitrary storage name. In v1 this was a silent
      no-op for any names other than ('local','session','').
 
-     - In Worker threads, an empty string argument is treated as a
-     storage unit name.
+     - In threads where local/sessionStorage are not available, an
+     empty string argument is treated as a storage unit name.
+
+     - It throws if a db currently has the storage opened. That
+     version 1 did not throw for this case was due to an architectural
+     limitation which has since been overcome.
   */
-  capi.sqlite3_js_kvvfs_clear = function(which=""){
-    let rc = 0;
-    const store = kvvfsWhich(which);
+  capi.sqlite3_js_kvvfs_clear = function callee(which=""){
+    if( !which && cache.storagePool.local ){
+      return callee('local') + callee('session');
+    }
+    const store = storageForZClass(which);
+    if( !store ) return 0;
     const keyPrefix = store.prefix;
-    /**
-       Historically this code had no way to check whether the storage
-       was in use before wiping it, so could not error in that
-       case. Whether or not it should, now that it can (as of late
-       2025-11), is TBD.
-    */
-    store.stores.forEach((s)=>{
-      const toRm = [] /* keys to remove */;
-      let i, n = s.length;
-      //debug("kvvfs_clear",store,s);
-      for( i = 0; i < n; ++i ){
-        const k = s.key(i);
-        //debug("kvvfs_clear ?",k);
-        if(!keyPrefix || k.startsWith(keyPrefix)) toRm.push(k);
-      }
-      toRm.forEach((kk)=>s.removeItem(kk));
-      rc += toRm.length;
-    });
-    //if( store.cts ) alertFilesToReload(store.cts);
-    return rc;
+    /*undecided:
+    if( store.files.length ){
+      toss3(capi.SQLITE_ACCESS,
+            "Cannot clear in-use database storage.");
+    }*/
+    const s = store.storage;
+    const toRm = [] /* keys to remove */;
+    let i, n = s.length;
+    //debug("kvvfs_clear",store,s);
+    for( i = 0; i < n; ++i ){
+      const k = s.key(i);
+      //debug("kvvfs_clear ?",k);
+      if(!keyPrefix || k.startsWith(keyPrefix)) toRm.push(k);
+    }
+    toRm.forEach((kk)=>s.removeItem(kk));
+    //alertFilesToReload(store);
+    return toRm.length;
   };
 
   /**
@@ -976,30 +917,27 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
      key and value, noting that JavaScript stores each character in 2
      bytes.
 
-     If passed 'local' or 'session' or '' from a thread other than the
-     main UI thread, this is effectively a no-op and returns 0.
-
      The returned size is not authoritative from the perspective of
      how much data can fit into localStorage and sessionStorage, as
      the precise algorithms for determining those limits are
      unspecified and may include per-entry overhead invisible to
      clients.
   */
-  capi.sqlite3_js_kvvfs_size = function(which=""){
-    let sz = 0;
-    const store = kvvfsWhich(which);
-    //warn("kvvfs_size storage",store);
-    store?.stores?.forEach?.((s)=>{
-      //warn("kvvfs_size backend",s);
-      let i;
-      for(i = 0; i < s.length; ++i){
-        const k = s.key(i);
-        if(!store.prefix || k.startsWith(store.prefix)){
-          sz += k.length;
-          sz += s.getItem(k).length;
-        }
+  capi.sqlite3_js_kvvfs_size = function callee(which=""){
+    if( !which && cache.storagePool.local ){
+      return callee('local') + callee('session');
+    }
+    const store = storageForZClass(which);
+    if( !store ) return 0;
+    const s = store.storage;
+    let i, sz = 0;
+    for(i = 0; i < s.length; ++i){
+      const k = s.key(i);
+      if(!store.prefix || k.startsWith(store.prefix)){
+        sz += k.length;
+        sz += s.getItem(k).length;
       }
-    });
+    }
     return sz * 2 /* because JS uses 2-byte char encoding */;
   };
 
@@ -1011,7 +949,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
      - "name": the name of the storage. This is 'local' or 'session'
      for localStorage resp. sessionStorage, and an arbitrary name for
      transient storage. This propery may be changed before passing
-     this object to sqlite3_js_kvvfs_import_storage() in order to
+     this object to sqlite3_js_kvvfs_import() in order to
      import into a different storage object.
 
      - "timestamp": the time this function was called, in Unix
@@ -1023,22 +961,26 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
      journal, it is stored as a string here, otherwise this property
      is not set.
 
-     - "pages": An array holddig the object holding the raw encoded
-     db pages in their proper order.
+     - "pages": An array holding the raw encoded db pages in their
+     proper order.
 
      Throws if this db is not opened.
 
      The encoding of the underlying database is not part of this
-     interface - it is simply passed on as-is. Interested parties
-     are directed to src/os_kv.c in the SQLite source tree.
+     interface - it is simply passed on as-is. Interested parties are
+     directed to src/os_kv.c in the SQLite source tree, with the
+     caveat that that code also does not offer a public interface.
+     i.e. the encoding is a private implementation detail of kvvfs.
+     The format may be changed in the future but kvvfs will continue
+     to support the current form.
 
      Added in version 3.?? (tenatively 3.52).
   */
-  capi.sqlite3_js_kvvfs_export_storage = function(storageName,includeJournal=true){
+  capi.sqlite3_js_kvvfs_export = function(storageName,includeJournal=true){
     const store = storageForZClass(storageName);
     if( !store ){
-      util.toss3(capi.SQLITE_NOTFOUND,
-                 "There is no kvvfs storage named",storageName);
+      toss3(capi.SQLITE_NOTFOUND,
+            "There is no kvvfs storage named",storageName);
     }
     //debug("store to export=",store);
     const s = store.storage;
@@ -1067,7 +1009,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
           default:
             kk = +kk /* coerce to number */;
             if( !util.isInt32(kk) || kk<=0 ){
-              util.toss3(capi.SQLITE_RANGE, "Malformed kvvfs key: "+k);
+              toss3(capi.SQLITE_RANGE, "Malformed kvvfs key: "+k);
             }
             pages[kk] = s.getItem(k);
             break;
@@ -1081,13 +1023,14 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
       (v)=>rc.pages.push(pages[v])
     );
     return rc;
-  }/* capi.sqlite3_js_kvvfs_export_storage */;
+  }/* capi.sqlite3_js_kvvfs_export */;
 
   /**
      INCOMPLETE. This interface is subject to change.
 
-     The counterpart of sqlite3_js_kvvfs_export_storage(). Its
-     argument must be the result of that function().
+     The counterpart of sqlite3_js_kvvfs_export(). Its
+     argument must be the result of that function() or
+     a compatible one.
 
      This either replaces the contents of an existing transient
      storage object or installs one named exp.name, setting
@@ -1095,7 +1038,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
 
      Throws on error. Error conditions include:
 
-     - The give storage object is currently opened by any db.
+     - The given storage object is currently opened by any db.
      Performing this page-by-page import would invoke undefined
      behavior on them.
 
@@ -1107,45 +1050,47 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
      conditions before reaching that step, in which case the db is
      not modified.
   */
-  capi.sqlite3_js_kvvfs_import_storage = function(exp, overwrite=false){
+  capi.sqlite3_js_kvvfs_import = function(exp, overwrite=false){
     if( !exp?.timestamp
         || !exp.name
         || undefined===exp.size
         || exp.size<0 || exp.size>=0x7fffffff
         || !Array.isArray(exp.pages) ){
-      util.toss3(capi.SQLITE_MISUSE, "Malformed export object.");
+      toss3(capi.SQLITE_MISUSE, "Malformed export object.");
     }
     //warn("importFromObject() is incomplete");
     let store = storageForZClass(exp.name);
     if( store ){
       if( !overwrite ){
         //warn("Storage exists:",arguments,store);
-        util.toss3(capi.SQLITE_ACCESS,
-                   "Storage '"+exp.name+"' already exists and",
-                   "overwrite was not specified.");
+        toss3(capi.SQLITE_ACCESS,
+              "Storage '"+exp.name+"' already exists and",
+              "overwrite was not specified.");
       }else if( !store.files || !store.jzClass ){
-        util.toss3(capi.SQLITE_ERROR,
-                   "Internal storage object", exp.name,"seems to be malformed.");
+        toss3(capi.SQLITE_ERROR,
+              "Internal storage object", exp.name,"seems to be malformed.");
       }else if( store.files.length ){
-        util.toss3(capi.SQLITE_IOERR_ACCESS,
-                   "Cannot import db storage while it is in use.");
+        toss3(capi.SQLITE_IOERR_ACCESS,
+              "Cannot import db storage while it is in use.");
       }
       capi.sqlite3_js_kvvfs_clear(exp.name);
     }else{
       if( cache.rxJournalSuffix.test(exp.name) ){
-        /* This isn't actually a problem, but the public API does not
-           specifically expose the '-journal' name of the storage so
-           exporting it "shouldn't happen." */
-        util.toss3(capi.SQLITE_MISUSE,
-                   "Cowardly refusing to create storage with a",
-                   "'-journal' suffix.");
+        /* kvvfs's xOpen() specifically prohibits that db files have a
+           suffix of "-journal" because it has a very specific meaning
+           in kvvfs. We report it here, rather than waiting on a
+           pending xOpen() to catch it, because xOpen() has no way of
+           reporting an error message. */
+        toss3(capi.SQLITE_MISUSE,
+              "Cowardly refusing to create storage with a",
+              "'-journal' suffix.");
       }
       store = newStorageObj(exp.name);
       cache.storagePool[exp.name] =
         cache.storagePool[exp.name+'-journal'] = store;
       //warn("Installing new storage:",store);
     }
-    //debug("Importing store",store.cts.files.length, store);
+    //debug("Importing store",store.poolEntry.files.length, store);
     //debug("object to import:",exp);
     const keyPrefix = kvvfsKeyPrefix(exp.name);
     try{
@@ -1219,7 +1164,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
 
     if( sqlite3.__isUnderTest ){
       jdb.test = {
-        kvvfsWhich,
+        storageForZClass,
         cache
       }
     }/* __isUnderTest */
index 6496f23498fd655431433c3a68150ca8bb31aad2..95bcf4431a3d0b760956cadc57649ff947026433 100644 (file)
@@ -1590,22 +1590,16 @@ int sqlite3__wasm_posix_create_file( const char *zFilename,
 ** This function is NOT part of the sqlite3 public API. It is strictly
 ** for use by the sqlite project's own JS/WASM bindings.
 **
-** Allocates sqlite3KvvfsMethods.nKeySize bytes from
-** sqlite3__wasm_pstack_alloc() and returns 0 if that allocation fails,
-** else it passes that string to kvrecordMakeKey() and returns a
-** NUL-terminated pointer to that string. It is up to the caller to
-** use sqlite3__wasm_pstack_restore() to free the returned pointer.
+** This returns a pointer to a static buffer, so it must be copied
+** if it needs to be retained across two calls to this function.
 */
 SQLITE_WASM_EXPORT
-char * sqlite3__wasm_kvvfsMakeKeyOnPstack(const char *zClass,
-                                          const char *zKeyIn){
+const char * sqlite3__wasm_kvvfsMakeKey(const char *zClass,
+                                        const char *zKeyIn){
+  static char buf[SQLITE_KVOS_SZ+1] = {0};
   assert(sqlite3KvvfsMethods.nKeySize>24);
-  char *zKeyOut =
-    (char *)sqlite3__wasm_pstack_alloc(sqlite3KvvfsMethods.nKeySize);
-  if(zKeyOut){
-    kvrecordMakeKey(zClass, zKeyIn, zKeyOut);
-  }
-  return zKeyOut;
+  kvrecordMakeKey(zClass, zKeyIn, buf);
+  return buf;
 }
 
 /*
index 1e4aa2bc40d4d8cfcc5f897a3965c68ae2ff926d..11eb440e66dd0d226cb02cb85011fe952d049be5 100644 (file)
@@ -2888,11 +2888,10 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
         const JDb = sqlite3.oo1.JsStorageDb;
         const pVfs = capi.sqlite3_vfs_find('kvvfs');
         T.assert(looksLikePtr(pVfs));
-        let x = JDb.test.kvvfsWhich('');
-        T.assert( 2 === x?.stores?.length )
-          .assert( x.stores.indexOf(globalThis.sessionStorage)>-1 )
-          .assert( x.stores.indexOf(globalThis.localStorage)>-1 )
-          .assert( 'kvvfs-' === x.prefix );
+        let x = JDb.test.storageForZClass('session');
+        T.assert( 0 === x.files.length )
+          .assert( globalThis.sessionStorage===x.storage )
+          .assert( 'kvvfs-session-' === x.keyPrefix );
         const filename = this.kvvfsDbFile = 'session';
         const unlink = this.kvvfsUnlink = ()=>JDb.clearStorage(filename);
         unlink();
@@ -2930,10 +2929,12 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
         ];
         try {
           T.assert( 0===db.storageSize(), "expecting 0 storage size" );
-          db.clearStorage(/*must not throw*/);
+          //T.mustThrowMatching(()=>db.clearStorage(), /in-use/);
+          db.clearStorage();
           T.assert( 0===db.storageSize(), "expecting 0 storage size" );
           db.exec(sqlSetup);
           T.assert( 0<db.storageSize(), "expecting non-0 db size" );
+          //T.mustThrowMatching(()=>db.clearStorage(), /in-use/);
           db.clearStorage(/*wiping everything out from under it*/);
           T.assert( 0===db.storageSize(), "expecting 0 storage size" );
           db.exec(sqlSetup/*that actually worked*/);
@@ -2945,7 +2946,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
           T.assert(3 === db.selectValue('select count(*) from kvvfs'));
           close();
 
-          const exportDb = capi.sqlite3_js_kvvfs_export_storage;
+          const exportDb = capi.sqlite3_js_kvvfs_export;
           db = new JDb(filename);
           db.exec('insert into kvvfs(a) values(4),(5),(6)');
           T.assert(6 === db.selectValue('select count(*) from kvvfs'));
@@ -3014,7 +3015,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
         }, capi.SQLITE_RANGE);
 
         try {
-          const exportDb = capi.sqlite3_js_kvvfs_export_storage;
+          const exportDb = capi.sqlite3_js_kvvfs_export;
           const dbFileRaw = 'file:'+filename+'?vfs=kvvfs&delete-on-close=1';
           db = new DB(dbFileRaw);
           capi.sqlite3_js_kvvfs_clear(filename);
@@ -3035,7 +3036,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
             finally{ddb.close()}
           }, /.*no such table: kvvfs.*/);
 
-          const importDb = capi.sqlite3_js_kvvfs_import_storage;
+          const importDb = capi.sqlite3_js_kvvfs_import;
           duo = new JDb(filename);
           T.mustThrowMatching(()=>importDb(exp,true), /.*in use.*/);
           duo.close();
index 8b843f7dcec52a36e5742b275d7c5bae71966947..c56d923a27e4b2b77f56e94538dddc6b0cef4196 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Disallow\sa\sfilename\sof\s'-journal'\sfor\sdb\sfiles\sin\skvvfs,\sas\sthat\sname\shas\sa\sspecial\smeaning\sthere.
-D 2025-11-25T03:09:45.693
+C Factor\sout\ssome\snow-superfluous\sJS-side\skvvfs\scode.\sFactor\sout\sa\ssuperfluous\sallocation.\sShorten\sthe\spublic\sAPI\snames\sof\sthe\snew\smethods.
+D 2025-11-25T04:07:50.280
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -600,11 +600,11 @@ F ext/wasm/api/sqlite3-api-worker1.c-pp.js 1041dd645e8e821c082b628cd8d9acf70c667
 F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89
 F ext/wasm/api/sqlite3-opfs-async-proxy.js 9654b565b346dc609b75d15337f20acfa7af7d9d558da1afeb9b6d8eaa404966
 F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c8fb7f0630264e6c7fa0e57515d
-F ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js 1be3e7c0d3ddfec5222b5d541338e76f5a96983c215ea777645c6670482dc786
+F ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js d6336194ad6b0516fc452f1dee4b3fdb59df09b2c7f5de5d00f3ce1f27c080de
 F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js a2eea6442556867b589e04107796c6e1d04a472219529eeb45b7cd221d7d048b
 F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 88ce2078267a2d1af57525a32d896295f4a8db7664de0e17e82dc9ff006ed8d3
 F ext/wasm/api/sqlite3-vtab-helper.c-pp.js 9097074724172e31e56ce20ccd7482259cf72a76124213cbc9469d757676da86
-F ext/wasm/api/sqlite3-wasm.c 1837eac45775ca92f28bf94921a2cf7f6f9d7a77955f95005399c57975e7d080
+F ext/wasm/api/sqlite3-wasm.c e5d2a31743b93a8c9e3ab6f63c5d0542666d20054fab36d65c95b3a3f4b734ca
 F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js bda1c75bd674a92a0e27cc2f3d46dbbf21e422413f8046814515a0bd7409328a
 F ext/wasm/api/sqlite3-worker1.c-pp.js 802d69ead8c38dc1be52c83afbfc77e757da8a91a2e159e7ed3ecda8b8dba2e7
 F ext/wasm/c-pp-lite.c 943be1a36774d58385dca32de36fc18d4f432fe79f7aa35e6c85dd6a6b825bd0
@@ -647,7 +647,7 @@ F ext/wasm/test-opfs-vfs.html 1f2d672f3f3fce810dfd48a8d56914aba22e45c6834e262555
 F ext/wasm/test-opfs-vfs.js 1618670e466f424aa289859fe0ec8ded223e42e9e69b5c851f809baaaca1a00c
 F ext/wasm/tester1-worker.c-pp.html 0e432ec2c0d99cd470484337066e8d27e7aee4641d97115338f7d962bf7b081a
 F ext/wasm/tester1.c-pp.html 52d88fe2c6f21a046030a36410b4839b632f4424028197a45a3d5669ea724ddb
-F ext/wasm/tester1.c-pp.js 1873759a7458ca2af4bf0fce45c212f66beae42a060ad60239506cb55c15cfa4
+F ext/wasm/tester1.c-pp.js 433d6c9417f920ae5fd2fb09ff665f01893ef6b70d96e622a3e8efe097c87de1
 F ext/wasm/tests/opfs/concurrency/index.html 657578a6e9ce1e9b8be951549ed93a6a471f4520a99e5b545928668f4285fb5e
 F ext/wasm/tests/opfs/concurrency/test.js d08889a5bb6e61937d0b8cbb78c9efbefbf65ad09f510589c779b7cc6a803a88
 F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2
@@ -2178,8 +2178,8 @@ F tool/version-info.c 33d0390ef484b3b1cb685d59362be891ea162123cea181cb8e6d2cf6dd
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 7e7944f00792c5e7a9ea013f9c5d1f6bb6313070de20ec4ce262ff0b430f9801
-R 729aff900dd4a4d5d58bb57157ac4b16
+P 357cc42633efb85c3ca9bc3d6d46430e1ecaf2825e6bdd7d7b4e0f6865d0b599
+R 44c9ff67e944e4eb1b2a540fd288593c
 U stephan
-Z ec285b1ffd095292cac3ba6f520e43f2
+Z f1beb3859dfbeb8ae21ff433c8ab6e9d
 # Remove this line to create a well-formed Fossil manifest.
index 8423a72ecb780c94c97982173a37d088840b7c73..2518f8dff189163a2b10bdeca21d380e717c4ee0 100644 (file)
@@ -1 +1 @@
-357cc42633efb85c3ca9bc3d6d46430e1ecaf2825e6bdd7d7b4e0f6865d0b599
+be435b668f1aee56fc4965592c207de25283de238fe89002f1a68ba0567aca65