From 773fa280631ceb3a1fed61f6776f01ffd76cfa1d Mon Sep 17 00:00:00 2001 From: pedrocarlo Date: Fri, 10 Oct 2025 15:51:31 -0300 Subject: [PATCH] workaround in sqlite for schema changes become visible to other connections --- simulator/runner/execution.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/simulator/runner/execution.rs b/simulator/runner/execution.rs index 3cc720967..1e30de520 100644 --- a/simulator/runner/execution.rs +++ b/simulator/runner/execution.rs @@ -341,6 +341,9 @@ fn execute_query_rusqlite( connection: &rusqlite::Connection, query: &Query, ) -> rusqlite::Result>> { + // https://sqlite.org/forum/forumpost/9fe5d047f0 + // Due to a bug in sqlite, we need to execute this query to clear the internal stmt cache so that schema changes become visible always to other connections + connection.query_one("SELECT * FROM pragma_user_version()", (), |_| Ok(()))?; match query { Query::Select(select) => { let mut stmt = connection.prepare(select.to_string().as_str())?;