fix: support passing file:// URI when using custom-compile SQLite#1106
fix: support passing file:// URI when using custom-compile SQLite#1106aslushnikov wants to merge 1 commit intoWiseLibs:masterfrom
file:// URI when using custom-compile SQLite#1106Conversation
…E_USE_URI=1` I'm trying to use `better-sqlite3` with an SQLite that is compiled with `SQLITE_USE_URI=1`: ```js const db = SQLite(`file:///foo/bar?vfs=myfs&mode=ro&immutable=1`); ``` This, however, doesn't work right now, since there's an erroneous assertion in the database creation. With this patch, I can successfully connect to database. References WiseLibs#483
|
It might solve your problem in a hacky way but it does not feel like the correct solution since these things are not mutually exclusive. Checking if the directory exists makes sense regardless if you're using I don't know what the right solution is, but I feel like the current logic conflicts with the use of |
@Prinzhorn I agree that proper URI support would need to address these points, and this is discussed to some extend in #483 However, some of the extensions actually rely on the "fake URI", like this one: https://github.com/mlin/sqlite_web_vfs: const db = SQLite(`file:///__web__?vfs=web&mode=ro&immutable=1&web_uri=${encodeURIComponent(dbUrl)}`);Do you think it'd be possible to have some escape hatch for these kind of use cases? Thank you for your review. |
|
Looking for opinions on supporting this via an environment variable: #483 (comment) |
I'm trying to use
better-sqlite3with an SQLite that is compiled withSQLITE_USE_URI=1:This, however, doesn't work right now, since there's an erroneous assertion in the database creation.
With this patch, I can successfully connect to the database.
References #483