aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-oo1.c-pp.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2024-07-22 21:21:25 +0000
committerstephan <stephan@noemail.net>2024-07-22 21:21:25 +0000
commitfaf10c521fd79975c6dd66e79457eb4b6966c0ef (patch)
tree19f83b510f335acfa3c3fc12f9602bf4168dd5b5 /ext/wasm/api/sqlite3-api-oo1.c-pp.js
parent71e2bdb2b45c03d4ed5b8cfe3998a18881afbd76 (diff)
downloadsqlite-faf10c521fd79975c6dd66e79457eb4b6966c0ef.tar.gz
sqlite-faf10c521fd79975c6dd66e79457eb4b6966c0ef.zip
Move a block of JS code which was inadvertently (and harmlessly) moved in the previous checkin. Clarify the semantics of an internal-use-only API. Add another WAL-related JS test.
FossilOrigin-Name: 6cd9f55a975b5237efee8776efce7e7836b41905ca750f82be3b90aa04c1dff2
Diffstat (limited to 'ext/wasm/api/sqlite3-api-oo1.c-pp.js')
-rw-r--r--ext/wasm/api/sqlite3-api-oo1.c-pp.js25
1 files changed, 13 insertions, 12 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