I’m doing exactly what is told in article - and the code creates SQLite table, inserts values and fetches the data in df and show it on my tables.py page. → This is good and work as expected on my local machine. As soon as, I deploy the code to Community Cloud → On click of button it created table, I can see an empty df on screen with table headers.
But every insert statement that I run succesfully → nothing gets fetched in df and the table shown on screen is always empty. Because the same code work on local machine → I can’t pin point what is going on when I deploy this code. Is it not inserting the values in table or if it is why is it not fetching the values and show it to me on page?
Can you help?
Is there a way I can check the table properties and values on the deployed folder on the community cloud server?
Can anyone please help with my above question - I’m stuck.
I have used exact steps to create SQLite DB, table and insert statement. The code wroks on my local machine doesnt retrieve values when deployed - i can only see empty table.
According to my understanding @Ninad_Jagtap , after the writing the insert command , have you committed and close the connection before going to next part of the code??
Sorry @ferdy i didnt understand your reply. I have a very simple requirement where I use SQLite to capture some very basic information like question. I really dont need a fully SQL DB for it so decided to go for SQLite. It works on my local machine but doesnt when deployed on Azure or Streamlit cloud - tried on both.
I can see my table created beacuse it show me empty df, but when I perform insert operation successfully (no error returned) it still shows me empty df.
When our app is deployed in community cloud, it is put in a container where updating the sqlite, csv, etc. files are not supported. Well updating via github is different.
Reading the existing file is fine. But adding entries, deleting entries, updating entries to data files are not supported. This is because anything can happen in a container, Streamlit may reboot it, update system files, change container, etc. If this thing happens, Streamlit just pulls the app files from our github repository and sets the app to run again. We might occasionally able to save the data from time to time, but the state of sqlite, csv, etc. files would revert back to what it was in the github repository.
For deployed apps in the cloud, streamlit provides some guidance on how to connect to data sources.
For running streamlit apps locally, no issue there we can do whatever we want on the data file.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.