diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/wasm/api/sqlite3-api-oo1.c-pp.js | 25 | ||||
-rw-r--r-- | ext/wasm/tester1.c-pp.js | 6 |
2 files changed, 18 insertions, 13 deletions
diff --git a/ext/wasm/api/sqlite3-api-oo1.c-pp.js b/ext/wasm/api/sqlite3-api-oo1.c-pp.js index 55d7356e2..3d6a24c77 100644 --- a/ext/wasm/api/sqlite3-api-oo1.c-pp.js +++ b/ext/wasm/api/sqlite3-api-oo1.c-pp.js @@ -79,6 +79,15 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ } }.bind({counter: 0})); + /** + A map of sqlite3_vfs pointers to SQL code or a callback function + to run when the DB constructor opens a database with the given + VFS. In the latter case, the call signature is + (theDbObject,sqlite3Namespace) and the callback is expected to + throw on error. + */ + const __vfsPostOpenCallback = Object.create(null); + //#if enable-see /** Converts ArrayBuffer or Uint8Array ba into a string of hex @@ -108,7 +117,9 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ are set. It throws if more than one is set or if any are set to values of an invalid type. - Returns true if it applies the key, else an unspecified falsy value. + Returns true if it applies the key, else an unspecified falsy + value. Note that applying the key does not imply that the key is + correct, only that it was passed on to the db. */ const dbCtorApplySEEKey = function(db,opt){ if( !capi.sqlite3_key_v2 ) return; @@ -170,10 +181,10 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ try{ stmt = db.prepare("PRAGMA "+keytype+"="+util.sqlite3__wasm_qfmt_token(key, 1)); stmt.step(); + return true; }finally{ if(stmt) stmt.finalize(); } - return true; }; //#endif enable-see @@ -294,16 +305,6 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ } }; - - /** - A map of sqlite3_vfs pointers to SQL code or a callback function - to run when the DB constructor opens a database with the given - VFS. In the latter case, the call signature is - (theDbObject,sqlite3Namespace) and the callback is expected to - throw on error. - */ - const __vfsPostOpenCallback = Object.create(null); - /** Sets a callback which should be called after a db is opened with the given sqlite3_vfs pointer. The 2nd argument must be a diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js index b5125b0d8..6cdd0bddd 100644 --- a/ext/wasm/tester1.c-pp.js +++ b/ext/wasm/tester1.c-pp.js @@ -3151,7 +3151,11 @@ globalThis.sqlite3InitModule = sqlite3InitModule; .assert( dbytes.byteLength == nWrote ); let db2 = new u1.OpfsSAHPoolDb(dbName2); T.assert(db2 instanceof sqlite3.oo1.DB) - //.assert('wal' == db2.selectValue("pragma journal_mode=WAL")) + .assert('wal' !== db2.selectValue("pragma journal_mode") + /* importDb() unsets the WAL-mode header for + historical reasons. Because clients must + explicitly enable pragma locking_mode=exclusive + before using WAL, that behavior is retained. */) .assert(3 === db2.selectValue('select count(*) from t')); db2.close(); T.assert(true === u1.unlink(dbName2)) |