diff options
author | stephan <stephan@noemail.net> | 2023-07-20 09:06:42 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2023-07-20 09:06:42 +0000 |
commit | 0b518b8d656f8e76855fd010aa2ff72eeedc1f4c (patch) | |
tree | 8c5790863d30a7c032a035904e0e0b572d86f0ef /ext/wasm/tester1.c-pp.js | |
parent | 55f318e53f0dc9343b2bc87956a3ea263e06eba3 (diff) | |
download | sqlite-0b518b8d656f8e76855fd010aa2ff72eeedc1f4c.tar.gz sqlite-0b518b8d656f8e76855fd010aa2ff72eeedc1f4c.zip |
Filter the OPFS VFSes out of the sqlite3-node.mjs build. Add another level of subdirectory to the sahpool to later enable transparent support of client-provided files under the VFS's root dir. Rework the awkward sahpool-via-oo1 mapping.
FossilOrigin-Name: 080a4d0aba30d8f3802b49be4a113205f069b3bdea8cebf525d654055642ff62
Diffstat (limited to 'ext/wasm/tester1.c-pp.js')
-rw-r--r-- | ext/wasm/tester1.c-pp.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js index 56a4369cd..905340b23 100644 --- a/ext/wasm/tester1.c-pp.js +++ b/ext/wasm/tester1.c-pp.js @@ -3054,16 +3054,13 @@ globalThis.sqlite3InitModule = sqlite3InitModule; run. */) .assert(u1.getCapacity() + 2 === (await u2.addCapacity(2))) .assert(2 === (await u2.reduceCapacity(2))) - .assert(sqlite3.oo1.OpfsSAHPool.default instanceof Function) - .assert(sqlite3.oo1.OpfsSAHPool.default === - sqlite3.oo1.OpfsSAHPool[sahPoolConfig.name]) .assert(sqlite3.capi.sqlite3_js_vfs_list().indexOf(sahPoolConfig.name) >= 0); T.assert(0 === u1.getFileCount()); - const DbCtor = sqlite3.oo1.OpfsSAHPool.default; const dbName = '/foo.db'; - let db = new DbCtor(dbName); - T.assert(1 === u1.getFileCount()); + let db = new u1.OpfsSAHPoolDb(dbName); + T.assert(db instanceof sqlite3.oo1.DB) + .assert(1 === u1.getFileCount()); db.exec([ 'create table t(a);', 'insert into t(a) values(1),(2),(3)' @@ -3072,14 +3069,19 @@ globalThis.sqlite3InitModule = sqlite3InitModule; T.assert(3 === db.selectValue('select count(*) from t')); db.close(); T.assert(1 === u1.getFileCount()); - db = new DbCtor(dbName); + db = new u2.OpfsSAHPoolDb(dbName); T.assert(1 === u1.getFileCount()); db.close(); T.assert(1 === u1.getFileCount()) .assert(true === u1.unlink(dbName)) .assert(false === u1.unlink(dbName)) .assert(0 === u1.getFileCount()); - + if(0){ + /* Enable this block to inspect vfs's contents via the dev + console or OPFS Explorer browser extension. The + following bits will remove them. */ + return; + } T.assert(true === await u2.removeVfs()) .assert(false === await u1.removeVfs()) .assert(!sqlite3.capi.sqlite3_vfs_find(sahPoolConfig.name)); |