aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-prologue.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-11-01 07:49:49 +0000
committerstephan <stephan@noemail.net>2022-11-01 07:49:49 +0000
commit49048b148eac5f74eb6f1e9dfbd85ee8f95694a4 (patch)
tree6fcd456e95de58e06c0498c2b271da54051934ac /ext/wasm/api/sqlite3-api-prologue.js
parentc7dd9b60eb95ebd65e53ed238e77ecfe6247b3b0 (diff)
downloadsqlite-49048b148eac5f74eb6f1e9dfbd85ee8f95694a4.tar.gz
sqlite-49048b148eac5f74eb6f1e9dfbd85ee8f95694a4.zip
Significant cleanups and expansion of the sqlite3.opfs utilities. Add oo1.DB.dbVfsName(). Add VFS name to worker1:open's arguments and result.
FossilOrigin-Name: 86a341d7e061f946b39e8647ddd4743013b851b33ae9e6e755d8dbc53fba5286
Diffstat (limited to 'ext/wasm/api/sqlite3-api-prologue.js')
-rw-r--r--ext/wasm/api/sqlite3-api-prologue.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/ext/wasm/api/sqlite3-api-prologue.js b/ext/wasm/api/sqlite3-api-prologue.js
index a5ff0c40a..ca6fad8f8 100644
--- a/ext/wasm/api/sqlite3-api-prologue.js
+++ b/ext/wasm/api/sqlite3-api-prologue.js
@@ -1187,14 +1187,15 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
}
/**
- Given an `sqlite3*`, an sqlite3_vfs name, and an optional db
- name, returns a truthy value (see below) if that db handle uses
- that VFS, else returns false. If pDb is falsy then the 3rd
- argument is ignored and this function returns a truthy value if
- the default VFS name matches that of the 2nd argument. Results
- are undefined if pDb is truthy but refers to an invalid
- pointer. The 3rd argument specifies the database name of the
- given database connection to check, defaulting to the main db.
+ Given an `sqlite3*`, an sqlite3_vfs name, and an optional db name
+ (defaulting to "main"), returns a truthy value (see below) if
+ that db uses that VFS, else returns false. If pDb is falsy then
+ the 3rd argument is ignored and this function returns a truthy
+ value if the default VFS name matches that of the 2nd
+ argument. Results are undefined if pDb is truthy but refers to an
+ invalid pointer. The 3rd argument specifies the database name of
+ the given database connection to check, defaulting to the main
+ db.
The 2nd and 3rd arguments may either be a JS string or a WASM
C-string. If the 2nd argument is a NULL WASM pointer, the default
@@ -1209,14 +1210,14 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
bad arguments cause a conversion error when passing into
wasm-space, false is returned.
*/
- capi.sqlite3_js_db_uses_vfs = function(pDb,vfsName,dbName="main"){
+ capi.sqlite3_js_db_uses_vfs = function(pDb,vfsName,dbName=0){
try{
const pK = capi.sqlite3_vfs_find(vfsName);
if(!pK) return false;
else if(!pDb){
return pK===capi.sqlite3_vfs_find(0) ? pK : false;
}else{
- return pK===capi.sqlite3_js_db_vfs(pDb) ? pK : false;
+ return pK===capi.sqlite3_js_db_vfs(pDb,dbName) ? pK : false;
}
}catch(e){
/* Ignore - probably bad args to a wasm-bound function. */