You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sending an absolute path like /home/user/database.sqlite will happily create a valid URI like file:///home/user/database.sqlite.
Please do not rely that URI is malformed for local files and provide a reliable way to open files from local disk.
Workaround is to pass a file with relative path like ../../database.sqlite which makes the new Uri() throw exception which will be catched and _type correctly set to DatabaseType.File.
The text was updated successfully, but these errors were encountered:
Thank you for reporting this. Would adding a case for the file scheme be a sufficient resolution for you? I also think it would be worth adding the URL parsing to the test suite to avoid this bug in the future.
I missed that local files path is specified as file:/path/to/file in libSQL. Which actually works in your library, albeit it would maybe deserve a special handling in the code.
I found hard to understand that the options class has property Url where I am not actually passing a real URL. But it seems it is just a way how libSQL has it.
In case you would provide with an example with filename in your README.md and/or a documentation comment in the options class, I am fine with that :)
To ensure clarity I agree it would be a good idea to add a special case for handling the file: prefix explicitly for the connection URL rather than fully relying on the default fallback of using the filesystem. Added documentation on how to open different databases will also be a good addition.
Action points:
Add explicit case for connection URLs prefixed with file: (Go docs example)
Update documentation to show how to open various database locations
When I open file with absolute path, I get
InvalidOperationException: Unsupported scheme: file
.I am using Linux.
This happens because your logic for opening files is problematic:
Sending an absolute path like
/home/user/database.sqlite
will happily create a valid URI likefile:///home/user/database.sqlite
.Please do not rely that URI is malformed for local files and provide a reliable way to open files from local disk.
Workaround is to pass a file with relative path like
../../database.sqlite
which makes thenew Uri()
throw exception which will be catched and_type
correctly set toDatabaseType.File
.The text was updated successfully, but these errors were encountered: