Streamlit Recipes for CUBRID¶
Five standalone Streamlit recipes are provided in this directory. Each recipe is one .py file and can be run directly with streamlit run <file>.py.
All recipes use:
- Connection:
cubrid+pycubrid://dba@localhost:33000/testdb @st.cache_resourcefor SQLAlchemy engine caching- Tables prefixed with
cookbook_ - Integer
0/1for booleans (is_active) - Integer cents for money (
unit_price_cents) - A Reset Demo Data button that drops and recreates demo tables
Recipes¶
01_table_viewer.py- Live query display withst.dataframeand auto-refresh02_filters.py- Sidebar category and price filters with dynamicWHEREclauses03_kpis.py- KPI cards withst.metricusingCOUNT,SUM, andAVG04_charts.py- Grouped bar and line charts using native Streamlit chart APIs05_form_crud.py- Insert/update/delete flows usingst.form
One-command demo (Docker)¶
The compose file starts CUBRID 11.4 and a Streamlit service that installs the
pinned requirements on first start (a few minutes; later runs reuse the pip
cache). Recipes read DATABASE_URL from the environment (default
cubrid+pycubrid://dba@localhost:33000/testdb), and the compose service points
it at the co-located container. docker compose down -v resets everything.
Local setup (no Docker for the app)¶
Run¶
streamlit run 01_table_viewer.py
streamlit run 02_filters.py
streamlit run 03_kpis.py
streamlit run 04_charts.py
streamlit run 05_form_crud.py
Notes¶
- On first run, each recipe ensures demo tables exist and seeds sample rows when empty.
- If you want a clean state for a recipe, use its Reset Demo Data button.