How to connect to sqlite database in a private repo

Database connection playbooks is a quite helpful work!
Could anyone please add sqlite database into it?
I would like to share my code and app but not the database. Is it possible to connect the sqlite database in a private repo with secrets?
Need further guidance. Thanks!
Maybe I should switch to PostgreSQL, which can protect your database very well. But the sqlite is really slim.

Hi @qehs, welcome to the Streamlit community!

sqllite is a special case of databases, in that sqllite is a file that can be committed to a Git repo. Other databases, like postgres that you mention, are whole programs running in their own process on a server.

In the case of a private repo, the only way to make what you want work is to somehow be able to download that sqlite file into your app. Its possible that you could use secrets management to have SSH keys in your Streamlit sharing app that would allow you to clone a private repo into your Streamlit sharing app location. But that’s pretty close to having the sqlite database public.

So yes, if you want to have an app backed by a database, and you don’t want that data to be public, using a database such as postgres hosted somewhere else is probably the best solution.

Best,
Randy

3 Likes

Now I know where I should head. Thanks!

1 Like