connecting-streamlit-to-snowflake

Connect Streamlit apps to Snowflake using st.connection and secrets.toml.

224|23|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/streamlit/agent-skills --skill connecting-streamlit-to-snowflake-streamlit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: connecting-streamlit-to-snowflake
Source: https://github.com/streamlit/agent-skills/tree/main/developing-with-streamlit/skills/connecting-streamlit-to-snowflake
Command: npx skills add https://github.com/streamlit/agent-skills --skill connecting-streamlit-to-snowflake-streamlit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Connect Streamlit apps to Snowflake securely and manage credentials in a central place.

Core Features & Use Cases

  • Streamlined connections: Use st.connection("snowflake") to establish and reuse Snowflake connections across your app.
  • Secrets-driven configuration: Store credentials in .streamlit/secrets.toml to avoid hardcoding.
  • Multi-connection support: Define named connections (e.g., snowflake and snowflake_staging) for different environments or roles.
  • Parameterized queries: Use parameterized queries to prevent SQL injection and safely pass values.
  • Per-user access with callers' rights: Execute queries with the viewer's permissions when appropriate.

Quick Start

Create a Snowflake connection in a Streamlit app using st.connection('snowflake'), store credentials in .streamlit/secrets.toml, and run a sample query.

Frequently Asked Questions about connecting-streamlit-to-snowflake

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect a Streamlit app to Snowflake?

Connect a Streamlit app to Snowflake by calling st.connection('snowflake') and storing credentials in .streamlit/secrets.toml to establish and reuse a secure database connection.

How do I manage Snowflake credentials across multiple environments in Streamlit?

Manage Snowflake credentials across multiple environments by defining named connections, such as snowflake and snowflake_staging, in .streamlit/secrets.toml to support different roles without hardcoding.

Can I execute Snowflake queries with per-user permissions in Streamlit?

You can execute Snowflake queries with per-user permissions in Streamlit by utilizing caller's rights, which runs database queries with the viewer's specific access permissions.

How do I prevent SQL injection when querying Snowflake from Streamlit?

Prevent SQL injection when querying Snowflake from Streamlit by using parameterized queries, which safely pass values to the database connection and protect against malicious injection attempts.

Do I need to hardcode database credentials to use st.connection with Snowflake?

You do not need to hardcode database credentials to use st.connection with Snowflake. The Streamlit connection integrates directly with secrets management, pulling credentials from .streamlit/secrets.toml.