connecting-streamlit-to-snowflake

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

Updated Aug 29, 2025
One-click install
npx skills add https://github.com/DDTully/dotfiles --skill connecting-streamlit-to-snowflake-ddtully
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: connecting-streamlit-to-snowflake
Source: https://github.com/DDTully/dotfiles/tree/main/skills/.agent_skills/developing-with-streamlit/skills/connecting-streamlit-to-snowflake
Command: npx skills add https://github.com/DDTully/dotfiles --skill connecting-streamlit-to-snowflake-ddtully

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamlit apps often struggle with securely connecting to Snowflake and managing credentials across multiple environments. This skill provides a robust pattern for establishing connections, handling secrets, and coordinating multiple Snowflake connections within a Streamlit app.

Core Features & Use Cases

  • st.connection usage: establish a Snowflake connection with built-in pooling, secrets integration, and easy query execution.
  • Caller rights and multi-connection support: support for viewer-based access with caller's rights and management of multiple named connections.
  • Parameterized queries and write operations: safe data retrieval and writes using parameterized queries and session.write_pandas.

Quick Start

Create a Streamlit app, configure a Snowflake connection with st.connection("snowflake"), 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 securely?▼

To connect Streamlit to Snowflake securely, use the st.connection("snowflake") function to establish a connection with built-in pooling and integrate credentials via Streamlit secrets management, preventing hardcoded logins.

What is the best way to manage multiple Snowflake connections for different Streamlit viewers?▼

Managing multiple Snowflake connections for different viewers utilizes caller's rights support to enable per-user access, allowing the Streamlit app to coordinate multiple named connections for secure, individualized database interactions.

How do I parameterize queries and write data back to Snowflake from Streamlit?▼

Parameterize queries in Streamlit for safe data retrieval and use session.write_pandas to execute write operations back to Snowflake, ensuring robust data handling without SQL injection risks.

Does st.connection support secrets management for Snowflake credentials across environments?▼

Yes, st.connection supports secrets management for Snowflake credentials by integrating directly with Streamlit secrets, allowing you to securely configure and handle database logins across multiple environments.

Can I use caller's rights to enforce per-user Snowflake access in a Streamlit app?▼

Yes, you can use caller's rights to enforce per-user Snowflake access in a Streamlit app, which manages multiple named connections to ensure viewers interact with the database using their own secure credentials.