Marimo
Integrate your StarRocks cluster with Marimo, a reactive Python notebook built for reproducibility and interactivity.
Prerequisitesβ
First, start by installing Marimo and setting up a notebook according to the Marimo quickstart documentation.
You will also need the following packages:
pip install starrocks sqlalchemy pandas
Connecting to StarRocksβ
Use SQLAlchemy to create a connection engine. The connection string format is:
starrocks://username:password@host:port/database
import marimo as mo
import sqlalchemy as sa
engine = sa.create_engine("starrocks://username:password@<host>:9030")
Replace <host> with your StarRocks FE host.
Using Marimo UI for credentialsβ
To avoid hardcoding credentials, use Marimo's interactive UI elements to collect them at runtime.
Cell 1 β render input fields:
user = mo.ui.text(label="Username")
pw = mo.ui.text(label="Password", kind="password")
mo.hstack([user, pw])
Cell 2 β create the engine using the entered values:
engine = sa.create_engine(
f"starrocks://{user.value}:{pw.value}@<host>:9030"
)
Querying StarRocksβ
With the engine established, use pandas to run queries:
import pandas as pd
df = pd.read_sql("SELECT * FROM my_database.my_table LIMIT 100", engine)
mo.ui.table(df)

Multi-catalog support requires Marimo version 0.22.5 or later.