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
So after looking a little bit, the issues seems to be related to the query_params vec in establish.rs. Therefore the issue is not limited to immutable flag but related to the vector itself. Since we are formatting the file name like this only if the query_params has an element.
So I understand the problem now. The problem is that the file: parameter expect the pound symbol to be converted to url encoding however that's not possible due to this
Even if I manually convert hash to %23 it will convert it back to pound character and then the file: parameter will fail since it's expecting %23 and not a pound symbol.
A simple but not a great fix is
if !query_params.is_empty(){// This line to encode the filename to url encoding in sqlx/sqlx-sqlite/src/connection/establish.rs line 103
filename = urlencoding::encode(&filename).to_string();
filename = format!("file:{}?{}", filename, query_params.join("&"));
flags |= libsqlite3_sys::SQLITE_OPEN_URI;}
Bug Description
Cannot open sqlite database files when the
immutable
flag is used and the file name contains the '#' symbolMinimal Reproduction
A small code snippet or a link to a Github repo or Gist, with instructions on reproducing the bug.
The same happens when using
SqliteCOnnectOptions::new().filename(path)
as wellInfo
rustc --version
: rustc 1.68.2 (9eb3afe9e 2023-03-27)The text was updated successfully, but these errors were encountered: