diff options
author | stephan <stephan@noemail.net> | 2022-10-31 13:50:05 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-10-31 13:50:05 +0000 |
commit | 02d15a7ebd73a26e7d2b87f2a6c978170778ffcc (patch) | |
tree | 91b3ac5e319c39f9e9e3c75940b7274cbde5ba05 /ext/wasm/api/sqlite3-api-glue.js | |
parent | 43b442a6267bf28270a399c10334216969b7227f (diff) | |
download | sqlite-02d15a7ebd73a26e7d2b87f2a6c978170778ffcc.tar.gz sqlite-02d15a7ebd73a26e7d2b87f2a6c978170778ffcc.zip |
Worker1: use a list, rather than a single slot, to manage the default db link so that we can keep the least-recently-opened db as the default. Re-introduce worker1.export() but do not yet expose it until an equivalent import() (or open() option) is implemented.
FossilOrigin-Name: c7750c101d9b7baa31496731bc34ea0a9b2bad0c11e2b3e92a8c7b327135c1bb
Diffstat (limited to 'ext/wasm/api/sqlite3-api-glue.js')
-rw-r--r-- | ext/wasm/api/sqlite3-api-glue.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/wasm/api/sqlite3-api-glue.js b/ext/wasm/api/sqlite3-api-glue.js index 63425e538..1477af759 100644 --- a/ext/wasm/api/sqlite3-api-glue.js +++ b/ext/wasm/api/sqlite3-api-glue.js @@ -634,7 +634,13 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ const kvvfsStorage = (zClass)=> ((115/*=='s'*/===wasm.getMemValue(zClass)) ? sessionStorage : localStorage); - + + /** + Implementations for members of the object referred to by + sqlite3_wasm_kvvfs_methods(). We swap out the native + implementations with these, which use localStorage or + sessionStorage for their backing store. + */ const kvvfsImpls = { xRead: (zClass, zKey, zBuf, nBuf)=>{ const stack = pstack.pointer, @@ -696,7 +702,7 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ } } }/*kvvfsImpls*/; - for(let k of Object.keys(kvvfsImpls)){ + for(const k of Object.keys(kvvfsImpls)){ kvvfsMethods[kvvfsMethods.memberKey(k)] = wasm.installFunction( kvvfsMethods.memberSignature(k), |