Moving to per-tenant DB architecture

Our Streamlit app is currently served from a single DB and we use an auth function to determine which rows a user can access. We use the st.cache_resource for the DB connection.

We are moving our DB to Turso and where each user will have their own DB. How do we cache which DB a user can access in such a way that when multiple users are logged into the Streamlit app they don’t overwrite each other’s cached DB value?

Store each user’s connection in st.session_state.

Thanks. I was hoping it was going to be that simple.