Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bindings): handle accessMode in runtime bindings with OPFS #1960

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sumimakito
Copy link

@sumimakito sumimakito commented Feb 19, 2025

This is an amazing project with many great works. Thank you

Context

During my recent usage with duckdb-wasm with the recent OPFS support done by @e1arikawa (Thank you for the cool work!), I encountered an issue where the file/directory handles were always created even when I opened the database with read-only options like:

db.open({
    path: 'opfs://not_yet_existing.db',
    accessMode: DuckDBAccessMode.READ_ONLY, // We should NOT create any files/directories
})

Summary

Going deeper, it seems we didn't handle the accessMode in helper functions like prepareFileHandles. Therefore, in this pull request, I tried to add the missing parameters to these functions as optional ones and added several test cases for open operations as such with different accessMode in OPFS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant