URGENT : store a table in a database

Hello guys ,

I want to save this table into a database , how to do that please ?

@st.cache(allow_output_mutation=True)
def Input_Parameters():
return

X1 = st.number_input(โ€™ X1โ€™, min_value = 0, max_value =10 , step = 1)
X2 = st.number_input(โ€˜X2โ€™, min_value = 0 , max_value = 10 , step = 1)
X3= st.number_input(โ€˜X3โ€™, min_value = 0, max_value = 10 , step = 1)

if start_bot:

Input_Parameters().append(  
	{"X1":X1,
	"Y1":Y1,
	"Z1":Z1
	}
)

st.table(Input_Parameters())

I want the table stored in a database ,

Thanks for your help

I never understand why I never get any answers

Hi @Iheb :wave:

We have a number of tutorials in our documentation demonstrating how to connect Streamlit apps to popular data sources: Connect to data sources - Streamlit Docs

Do give them a read and let us know if they helped!

Happy Streamlit-ing! :balloon:
Snehan

I want to store the โ€œInput_Parameters()โ€ which is adding a line each time that I click on a button to a database.

the guide says :
โ€œThis guide explains how to securely access a PostgreSQL database from Streamlit Cloudโ€

I am currently working locally (I think) and I donโ€™t want complicated stuff. I have trouble.

I have few lines of code to store those results in a database .

For someone who knows , this will take less than 1 min โ€ฆ

The guide also explains how to connect to a PostgreSQL database that youโ€™re hosting locally. :slightly_smiling_face: If you skip the โ€œCopy your app secrets to the cloudโ€ section, the rest of the guide walks you through running your app locally and connecting to a local PostgreSQL database.

I am not going to follow streamlit documentation on this because itโ€™s shit.

I was expecting code . If there is , I would be thankful. If not , no more replies to tell me there are tutorials on streamlit . Many stuff were skipped.

Per the terms of service, if you continue to act abusive towards any user on this forum, your account will be closed.

This forum exists for users in the Streamlit community to interact with one another, sharing ideas and helping out where they can. For employees, we participate on a best-effort basis, as the Streamlit library is an open-source project. With several hundred posts per week here, Discord, StackOverflow, Reddit and on other social media, itโ€™s not feasible to answer every single question.

Let this notice be your only warning to remain civil in this community.

Best,
Randy

3 Likes

One , I have opened 4 topics and never get answers (only one and he added 2 lines to put it than in his github code )

Two , this guy , come to tell me there is a documentation , I know about the documentation but it is not well explained.

Three , you came here , you can make an effort to say that I am abusive but you donโ€™t give suggestion.

Four , this is a problem that makes me very nervous and it makes more nervous when someone give a useless answer ; just copy/paste and take โ€œhere it isโ€ .

No , itโ€™s not like that that we help people if we want it toโ€ฆthis is disrepectful but of course as you are in the same team whenver he does , he will alwayw be right. I know how it works.

Lastly , I have a lot better to do than come here and be abusive.