launchbadge / sqlx

🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite.
Apache License 2.0
13.15k stars 1.24k forks source link

Always set `SQLITE_OPEN_URI` on in-memory sqlite #3289

Open LecrisUT opened 3 months ago

LecrisUT commented 3 months ago

Does your PR solve an issue?

I have encountered this issue when trying to package a downstream project where the in-memory sqlite database was simply gone at subsequent accesses. The issue is that URI format is implicitly used, but the flag is never set https://github.com/launchbadge/sqlx/blob/1388fc8acc07b41ab38f4dc096f03ba9c7b851f8/sqlx-sqlite/src/options/parse.rs#L18-L23

This issue was not detected because only the bundled libsqlite3-sys version is tested which has the USE_URI compile flag enabled. On distros, however this is not yet enabled, and it is just started to be investigated ^1

Related to:

LecrisUT commented 3 months ago

@abonander can you review this PR?

LecrisUT commented 1 month ago

@abonander Gentle ping