aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-opfs.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-10-03 13:03:41 +0000
committerstephan <stephan@noemail.net>2022-10-03 13:03:41 +0000
commit4f5bbedb3aad0095caef387dc66e884bfc1f1675 (patch)
tree58445002e5c48f8151a1ea20dbed5d8f29ebf8cb /ext/wasm/api/sqlite3-api-opfs.js
parenta4c357f94c8c5408c18e1f020a6267985c889254 (diff)
downloadsqlite-4f5bbedb3aad0095caef387dc66e884bfc1f1675.tar.gz
sqlite-4f5bbedb3aad0095caef387dc66e884bfc1f1675.zip
Export sqlite3_trace_v2() to wasm and use it to ensure that the new per-VFS post-open SQL support in the DB ctor works. Default opfs vfs to journal_mode=truncate, as it's faster in that mode. Add 't' DB open-mode flag to enable SQL tracing to console.log().
FossilOrigin-Name: 508f7f6d63e52f61fae5abe817579a4e130fa7fbd18733d741d521a5bdabb7ce
Diffstat (limited to 'ext/wasm/api/sqlite3-api-opfs.js')
-rw-r--r--ext/wasm/api/sqlite3-api-opfs.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/wasm/api/sqlite3-api-opfs.js b/ext/wasm/api/sqlite3-api-opfs.js
index 9588fc8a2..42c0e1166 100644
--- a/ext/wasm/api/sqlite3-api-opfs.js
+++ b/ext/wasm/api/sqlite3-api-opfs.js
@@ -898,8 +898,14 @@ const installOpfsVfs = function callee(asyncProxyUri = callee.defaultProxyUri){
sqlite3.oo1.dbCtorHelper.call(this, opt);
};
opfsUtil.OpfsDb.prototype = Object.create(sqlite3.oo1.DB.prototype);
+ sqlite3.oo1.dbCtorHelper.setVfsPostOpenSql(
+ opfsVfs.pointer,
+ /* Truncate journal mode is faster than delete or wal for
+ OPFS, per speedtest1. */
+ "pragma journal_mode=truncate"
+ );
}
-
+
/**
Potential TODOs:
@@ -907,7 +913,6 @@ const installOpfsVfs = function callee(asyncProxyUri = callee.defaultProxyUri){
publish an interface for proxying the higher-level OPFS
features like getting a directory listing.
*/
-
const sanityCheck = function(){
const scope = wasm.scopedAllocPush();
const sq3File = new sqlite3_file();