Overview

Streamlit 1.28, released on October 20, 2023, introduces st.connection to simplify connecting to databases and external APIs.

Main Features

st.connection provides a unified interface with built-in caching for SQL, Snowflake and custom connectors.

python
import streamlit as st

conn = st.connection('my_db', type='sql')
df = conn.query('SELECT * FROM users LIMIT 10')
st.dataframe(df)

Sources