Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 afterfs.existsSync()
succeeded but beforesqlite3_open_v2()
tries to open the file).Closes #483