ddtully/dotfiles/connecting-streamlit-to-snowflake
Claude Code and agent skill by ddtully/dotfiles
- community
Checking that the SKILL.md file is still in the repository.
Connecting Streamlit apps to Snowflake. Use when setting up database connections, managing secrets, or querying Snowflake from a Streamlit app.
Install
npx vskill@latest install ddtully/dotfiles/connecting-streamlit-to-snowflakeSKILL.md
The same SKILL.md was published earlier as aibot88/sec_skill_store/connecting-streamlit-to-snowflake.
Streamlit Snowflake connection
Connect your Streamlit app to Snowflake the right way.
Use st.connection
Always use st.connection("snowflake") instead of raw connectors.
Why st.connection:
- Automatic connection pooling
- Built-in caching
- Handles reconnection
- Works with st.secrets
Caller's rights connection (Streamlit 1.53+)
For apps running in Snowflake, use caller's rights to run queries with the viewer's permissions instead of the app owner's:
This is useful when:
- Different users should see different data based on their Snowflake roles
- You want row-level security to apply based on the viewer
- You don't want the app to have elevated permissions
Cached queries
Use the built-in ttl parameter to cache query results:
Configure with st.secrets
Store credentials in .streamlit/secrets.toml (never commit this file).
CRITICAL: Derive the account and host values from the user's Snowflake CLI connection config. Run snow connection list and use the exact values. A wrong account will redirect to the wrong login page.
Add to .gitignore:
Parameterized queries
Use parameters to prevent SQL injection:
Write data
Use the session for write operations:
Multiple connections
Define multiple connections in secrets:
Chat with Cortex
Build a chat interface using Snowflake Cortex LLMs:
See building-streamlit-chat-ui for more chat patterns (avatars, suggestions, history management).
Python 3.12+ dependency caveat
streamlit[snowflake] gates snowflake-connector-python on python_version < "3.12". On Python 3.12+, the connector is silently skipped and you get No module named 'snowflake' at runtime. Always add snowflake-connector-python>=3.3.0 as an explicit dependency in pyproject.toml:
References
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/.agent_skills/developing-with-streamlit/skills/connecting-streamlit-to-snowflake/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ddtully/dotfiles/connecting-streamlit-to-snowflake)