aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-opfs.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-11-02 11:53:31 +0000
committerstephan <stephan@noemail.net>2022-11-02 11:53:31 +0000
commitf45c33701dde9412e6aeab464a8148ab112bb033 (patch)
treee001384725393439c7f820dc5d21b3eecd90072e /ext/wasm/api/sqlite3-api-opfs.js
parentfaff0410dc6de77edb727eac65c570e604599a83 (diff)
downloadsqlite-f45c33701dde9412e6aeab464a8148ab112bb033.tar.gz
sqlite-f45c33701dde9412e6aeab464a8148ab112bb033.zip
Add sqlite3_wasm_vfs_create_file() to replace Emscripten's FS.createDataFile() in a (mostly) VFS-agnostic way. Add a test for worker1's export (to bytearray) support. Re-add worker1 open-from-bytearray using sqlite3_wasm_vfs_create_file() but it's untested (requires a new interactive test app or maybe reconsideration).
FossilOrigin-Name: b35e1225c91a3cadc0d25af1e4e790237256d194990faa13190e343ed03e11c5
Diffstat (limited to 'ext/wasm/api/sqlite3-api-opfs.js')
-rw-r--r--ext/wasm/api/sqlite3-api-opfs.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/wasm/api/sqlite3-api-opfs.js b/ext/wasm/api/sqlite3-api-opfs.js
index 90337d527..86285df1d 100644
--- a/ext/wasm/api/sqlite3-api-opfs.js
+++ b/ext/wasm/api/sqlite3-api-opfs.js
@@ -316,6 +316,8 @@ const installOpfsVfs = function callee(options){
*/
state.sq3Codes = Object.create(null);
[
+ 'SQLITE_ACCESS_EXISTS',
+ 'SQLITE_ACCESS_READWRITE',
'SQLITE_ERROR',
'SQLITE_IOERR',
'SQLITE_IOERR_ACCESS',
@@ -939,7 +941,7 @@ const installOpfsVfs = function callee(options){
*/
opfsUtil.entryExists = async function(fsEntryName){
try {
- const [dh, fn] = await opfsUtil.getDirForFilename(filename);
+ const [dh, fn] = await opfsUtil.getDirForFilename(fsEntryName);
await dh.getFileHandle(fn);
return true;
}catch(e){