From de57d009db7aa74727dd3007ab6b17d24c2a8922 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 5 Mar 2025 11:30:35 +0100 Subject: [PATCH] Force readonly mode --- scripts/plotly_streamlit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/plotly_streamlit.py b/scripts/plotly_streamlit.py index 36d3492..b50b3c9 100755 --- a/scripts/plotly_streamlit.py +++ b/scripts/plotly_streamlit.py @@ -54,7 +54,8 @@ st.markdown(""" @st.cache_resource() def get_connection(path: str): - return sqlite3.connect(path, check_same_thread=False) + uri = f"file:{path}?mode=ro&cache=shared" + return sqlite3.connect(uri, uri=True, check_same_thread=False) def get_data(_conn: Connection):