Skip to content

Vacuum and attach issues with sqlite #3284

Answered by esmevane
esmevane asked this question in Q&A
Discussion options

You must be logged in to vote

I wanted to update here since, although I haven't solved this, I have figured out a workaround.

The workaround. Changing the invocation string for the connection from ":memory:" (a memory-mode db) to "" (a temp file that sqlite manages) seems like it's enough of a difference for the vacuum and attach statements to start working.

These two statements seem very close to me in terms of the connection configuration they yield:

let options = dbg!(sqlx::sqlite::SqliteConnectOptions::from_str(":memory:"))?;
let options = dbg!(sqlx::sqlite::SqliteConnectOptions::from_str(""))?;

Here's that output:

[src/main.rs:255:19] sqlx::sqlite::SqliteConnectOptions::from_str(":memory:") = Ok(
    SqliteConnec…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by esmevane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant