Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always set SQLITE_OPEN_URI on in-memory sqlite #3281

Closed
wants to merge 1 commit into from

Conversation

LecrisUT
Copy link
Contributor

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

if database == ":memory:" {
options.in_memory = true;
options.shared_cache = true;
let seqno = IN_MEMORY_DB_SEQ.fetch_add(1, Ordering::Relaxed);
options.filename = Cow::Owned(PathBuf::from(format!("file:sqlx-in-memory-{seqno}")));
} else {

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:

Footnotes

  1. https://bugzilla.redhat.com/show_bug.cgi?id=2291157

@LecrisUT
Copy link
Contributor Author

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

@abonander abonander deleted the branch launchbadge:ab/fixes June 13, 2024 20:11
@abonander abonander closed this Jun 13, 2024
@LecrisUT LecrisUT deleted the patch-1 branch June 14, 2024 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants