What problem does it solve?
This guide shows how to connect Streamlit applications to Snowflake safely and correctly, avoiding hard-coded credentials, preventing SQL injection, and enabling efficient caching and session-based operations so apps remain performant and secure.
Core Features & Use Cases
- Secure connection management: Use st.connection and st.secrets patterns to avoid embedding credentials and enable automatic pooling and reconnection.
- Safe querying and caching: Run parameterized queries to prevent SQL injection and use TTL-based caching to reduce query load and latency.
- Permissions and writes: Use caller's rights to enforce viewer-based access, and use session-based writes for controlled data updates; integrate Snowflake Cortex LLMs for streaming assistant responses in chat UIs.
- Use Case: Build a role-aware dashboard that displays different rows to different users by using caller's rights, cached analytics queries, and parameterized filters.
Quick Start
Connect your Streamlit app to Snowflake using st.connection, configure credentials in .streamlit/secrets.toml, and run a parameterized query with TTL caching to display results.