How can I connect Streamlit to Clickhouse database?

Hello everyone,

I am trying to build a data app connected to Clickhouse but I am not sure if Streamlit will support it.
Will connecting Clickhouse to SqlAlchemy help?

hey @Calaf_Eabra! Welcome to the Streamlit forums :balloon:. If you connect your app to clickhouse through sqlalchemy I think that should work as sqlalchemy works in Streamlit Cloud. If you try something out and are hitting some errors, please let us know here and we can try and debug with you (given that you post some error messages + some code so we can reproduce!)

1 Like

Hi @Calaf_Eabra. You might look at ClickHouse Connect, which offers fairly simple reads and writes of Pandas dataframes to ClickHouse without needing SQLAlchemy.

1 Like

Thank you @ClickHouseGeoff that works well.