I am planning to deploy an app that uses SQLite database. Where do I host the DB file
Hey, thanks for posting,
Streamlit provides support for SQL database,
You can refer to this simple tutorial from the docsâŠ
This would be on either a server or a cloud based system which the app will be pointed to read is my understanding. Hopefully right
Yes you are right, this was for server like if you are deploying your appâŠ
But if you want to test it on your local then you can use SQLAlchemy
library to connect to your local SQLâŠ
You can look for this tutorial for some motivation
https://docs.streamlit.io/library/advanced-features/connecting-to-data
I followed the docs and set up my app. However, my db is Mysql. And the app is working fine with mysql connector when using # db_config = {
âuserâ: âuserâ,
âpasswordâ: âpasswdxxxxâ,
âhostâ: âxx.xxx.xxx.xxxâ,
âdatabaseâ: âMySQLDBâ
}
conn = mysql.connector.connect(**db_config).
Is there something I am missing as I am being asked to install sqlalchemy - wonder if I need to make changes to my code itself.
Thanks in advance
It is always fine if it is workingâŠ
The benifit you might get from SQLalchemy
is that, SQLAlchemy primarily uses ORM (Object-Relational Mapping) in order to abstract the details of handling the database. This can help avoid errors some times⊠whereas mysql connector works only with simple SQL
Got over this. Now struggling to import mathplotlib import matplotlib.pyplot as plt. Made another thread for this
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.