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
12.36k stars 1.18k forks source link

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

Closed LecrisUT closed 2 weeks ago

LecrisUT commented 3 weeks 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 weeks ago

PS: I am targeting ab/fixes right now because of the format CI changes, I will rebase and change targets once #3279 is merged