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

Wrap sqlite3 OPEN_URI option #785

Conversation

BurningEnlightenment
Copy link

@BurningEnlightenment BurningEnlightenment commented Mar 27, 2022

Add a boolean option to the Database constructor controlling the SQLITE_OPEN_URI flag. Obviously this isn't a superset of #735, but it implements its most requested feature.

I'm open to bikeshedding w.r.t. the option name.

Please note that I disabled the directory existance check if uriPath is passed. If the URI requests that a custom sqlite VFS implementation is used, the db path might not be accessible by the node fs APIs. Furthermore an extension can install itself as the default VFS, so it might make sense to completely remove that check. (Also note that it generally suffers from TOCTUO issues -- the directory can be deleted after fs.existsSync() succeeded but before sqlite3_open_v2() tries to open the file).

Closes #483

@mceachen
Copy link
Member

Nice! Can you add some tests please?

@BurningEnlightenment
Copy link
Author

Can you add some tests please?

I added a smoke test for the new option. Is that sufficient?

@BurningEnlightenment
Copy link
Author

Closing due to lack of activity / interest.

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

Successfully merging this pull request may close these issues.

Add option for enabling URI format
2 participants