Skip to content

Dashboards that are just SQL.

Tag the columns of an ordinary DuckDB SELECT with a ::ROLE and it becomes a chart, a KPI, a table or an input. Maps, forecasts, drill-downs, guarded servers and agents come from the same SQL file — no JavaScript, no config.

Real dashboards from the builder’s examples — a forecast against capacity, a map that drills — each one .sql file.

  • 42 chart kinds
  • 248 roles
  • 40 live examples
  • 5 anofox extensions plotted
  • 0 lines of JavaScript

Start with a single chart. Every step below adds a few lines to the same file — nothing has to be rewritten when it grows.

1

The cast on the measure picks the chart; the other columns say where each row goes. Sort and aggregate in SQL — the chart draws what the query returns.

SELECT region ::XAXIS, sum(revenue) ::BARCHART,
'North leads, South close behind'::TITLE
FROM sales GROUP BY ALL ORDER BY 2 DESC;

Every chart kind →

A sorted bar chart titled North leads, South close behind
2

KPI tiles with change, trend line and goal; a 12-column grid; boxes, tabs and sections — each a statement of its own.

SELECT 'Headline'::GROUP;
SELECT sum(revenue) ::MONEY, 'Revenue'::LABEL,
sum(revenue_prev) ::DELTA,
list(r ORDER BY week) ::SPARKLINE FROM …;
SELECT 1::ENDGROUP;
SELECT 8::COL;
SELECT week ::XAXIS, channel ::CATEGORY,
revenue ::AREACHART_STACKED FROM sales;

KPIs and tables → · Layout →

Three KPI tiles, a stacked area chart and a donut
3

An input’s column name is a DuckDB variable. Clicks set variables too: cross-filter, named selections, row selection, and drill-down through any hierarchy — on bars, maps and treemaps.

SELECT 'geo: country > state > district'::DRILL;
SELECT code ::REGION, name ::LABEL, revenue ::BARCHART,
'quantile 5'::CLASSES
FROM rm_level() -- reads getvariable('country'), …
ORDER BY revenue DESC;

Inputs and interactivity →

After a click on Germany: the map and the ranking by state, with a breadcrumb back
4

Load an anofox extension and plot its results: forecasts with nested interval fans, backtests, regression forests, survival curves, optimiser plans. Here: next week’s load per substation, three methods backtested, against firm capacity.

LOAD anofox_forecast;
CREATE TABLE fc AS
SELECT * FROM ts_forecast_by('load', substation, ds, mw, 'MSTL',
168, '1h', MAP{'seasonal_periods': '[24,168]'});
SELECT ds ::XAXIS, yhat ::LINECHART,
yhat_lower ::BAND_LOWER, yhat_upper ::BAND_UPPER,
firm_mw ::REFLINE,
'firm capacity' ::REFLINE_LABEL
FROM fc JOIN substations USING (substation)
WHERE substation = getvariable('substation');

Models and forecasts → · The extensions →

An hourly load forecast with a 95/80/50 % fan against a firm-capacity line, a weekday-by-hour heatmap and a peak table
5

Ship it — to a page, a server or an agent

Section titled “Ship it — to a page, a server or an agent”

The same file renders to HTML and SVG in CI, publishes as a static site, or runs on a locked, read-only server with login, row and column policies, scheduled reports and alerts. A dashboard’s -- @question lines can be answered over REST and MCP for the signed-in caller.

Terminal window
dashboard --check sales.sql --strict # lint in CI
dashboard --site dashboards/ public/ # a static site
serve --dashboards dashboards/ \
--db sales.duckdb --options locked.json

Which way to run it →

Example dashboards on made-up sample data, each built around a question a team might ask. Open one, read its SQL, change it.

The gallery shows every input, KPI, table option, map and interaction as a picture with the SQL that draws it — and what each anofox extension plots.

Rendered to crisp SVG by ggplot-rs, a grammar-of-graphics engine in Rust — the same picture in the browser, the CLI, a PDF export or an e-mail.

See all 42, with the data each one needs →

Plain files in GitA dashboard is a .sql file: review it in a pull request, diff it, blame it.
Linted in CIdashboard –check catches broken SQL, empty panels and design mistakes; a GitHub Action runs it on every PR.
Guarded when servedRead-only snapshots, login (OIDC, JWT, signed links), row and column policies, audit logs.
Written with an agentThe Claude Code plugin builds dashboards from a plain request; every SQL block in its skills is tested in CI.

Try it on your own data

Open the builder, load a CSV, Parquet or JSON file with Explore data, and tag a column.

Open the builder →Install the extension