Build a dashboard

Build a real-time, filterable dashboard straight from a SQL database — the kind of thing you'd reach for Superset, Metabase, or Grafana to do.

1. Connect your database

Add a Postgres or MySQL connection in the Data panel (encrypted, read-only). See Databases & SQL.

2. Add datasets

For each metric or table, add a SqlData brick with a SELECT and a target key — for example sales.byMonth, orders.recent. Aggregate in SQL (GROUP BY, date_trunc) so the database does the work and only summarized rows cross the wire.

3. Add filters

Add Select / Input controls with bindKeys (e.g. filter.region, filter.from), and reference them in each query's params ({ from: "filter.region" }, WHERE region = $1). Changing a filter re-runs the queries and updates every chart — see Datasets & filters.

4. Visualize

Bind charts to the datasets — StatCard for KPIs, LineChart / TimeSeries for trends, BarChart / PieChart for breakdowns, DataGrid for tables — and lay them out in a Grid. See Charts & visualizations.

5. Go real-time

Set a dataset's refresh interval (say, every 5 seconds) and the bound charts update live, Grafana-style. TimeSeries is ideal for streaming metrics.

Just describe it: "a sales dashboard from my Postgres — revenue by month, top regions, and a recent-orders table, with a region filter, refreshing every minute." The agent connects the pieces; you refine.

Next steps