Streamlit ERD Viewer in Snowflake
A while ago I wrote about an Entity-Relationship Diagram (ERD) generator for Snowflake, implemented as a separate proof-of-concept Python project using the Snowflake Connector.
While Streamlit in Snowflake is now in Public Preview, let’s see how simple it is to build this project directly within your Snowflake account, as a Streamlit App, in just 5 minutes or so. My full free open-source implementation is on GitHub.
Streamlit in Snowflake
You can now create a Streamlit App from the web UI, or by SQL:
I took a step further, and I created a deploy script that you can instantly run with snowsql -c my_conn -f scripts/deploy.sql.
Run it from your local computer — after adjusting the path of your local file — as you cannot execute the PUT command from a Snowflake worksheet:
CREATE OR REPLACE DATABASE streamlit_erd_viewer;
CREATE STAGE stage
directory = (enable=true)
file_format = (type=CSV field_delimiter=None record_delimiter=None);
PUT file://C:\Projects\streamlit-apps\streamlit-erd-viewer\app.py @stage
overwrite=true auto_compress=false;
CREATE STREAMLIT…