/open-dashboard:connect-databasefrom open-dashboard
Connects an open-dashboard workspace to databases and data warehouses including Postgres, SQLite, MySQL, SQL Server, Oracle, DuckDB, ClickHouse, BigQuery, and Snowflake. Handles connection strings, file paths, and read-only login setup.
Ships in open-dashboard. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You edit open-dashboard.config.ts and .env, and install a driver if one is
needed. Nothing else.
pnpm exec open-dashboard drivers # every supported type, its package, how it stays read-only
Per-engine config, .env format, read-only grants and common errors:
references/engines.md.
Ask only for what you cannot see. One AskUserQuestion call at most:
Engine — map the product to a type:
| They say | type |
|---|---|
| Postgres, Supabase, Neon, RDS/Aurora Postgres, Cloud SQL, AlloyDB, Redshift, CockroachDB, TimescaleDB | postgres |
| MySQL, MariaDB, PlanetScale, TiDB, RDS/Aurora MySQL | mysql |
| SQL Server, Azure SQL, RDS for SQL Server | mssql |
| Oracle, Autonomous Database | oracle |
a .db / .sqlite file | sqlite |
a .duckdb file, or Parquet / CSV / JSON files | duckdb |
| ClickHouse, ClickHouse Cloud | clickhouse |
| BigQuery | bigquery |
| Snowflake | snowflake |
| a JSON HTTP API (REST, open data portals) | http |
| an MCP server (its read-only tools) | mcp |
| JSON or JSON Lines files in the workspace (exports, logs, results) | json |
| CSV or TSV files in the workspace (spreadsheet exports) | csv |
MongoDB, Elasticsearch, DynamoDB and other non-SQL stores have no driver of
their own. If they expose a JSON HTTP API or an MCP server, use http /
mcp; otherwise say so plainly and suggest a SQL layer they may already have
(a warehouse export, Athena, DuckDB over an export).
Where — a file path, a connection string, or (BigQuery / Snowflake) the project / account identifiers.
A name — short, lowercase: shop, warehouse, billing. It appears in
-- source: lines, so it should say which database it is.
Never ask the user to paste a password into the chat if they can avoid it.
Tell them to put the secret in .env themselves, and you reference the
variable. If they already pasted it, write it to .env and do not repeat it back.
open-dashboard keeps every query read-only on every engine (the per-engine
mechanism is in open-dashboard drivers). Still give the user the read-only
grant for their engine from references/engines.md —
it is the real protection, it stops a slow dashboard query holding write locks,
and on SQL Server and Snowflake (no read-only transactions) it matters most.
For production, suggest a replica.
// open-dashboard.config.ts
import type { OpenDashboardConfig } from '@open-dashboard/core'
export default {
datasources: {
app: { type: 'postgres', url: process.env.APP_DATABASE_URL ?? '' },
erp: { type: 'mssql', url: process.env.ERP_MSSQL_URL ?? '' },
events: { type: 'clickhouse', url: process.env.CLICKHOUSE_URL ?? '' },
},
defaultSource: 'app',
} satisfies OpenDashboardConfig
Secrets come from process.env; .env is loaded for you and reloads on save.
defaultSource is used by queries without a -- source: line. With one
datasource it is implied.
File paths (SQLite, DuckDB, key files) are relative to the workspace root.
JSON and CSV files must sit inside the workspace (put them under data/).
A table names one file or a glob; a glob stacks every match and adds
_file, its path — the way to read a folder of exports or result files:
evals: { type: 'json', tables: { results: { file: 'data/results/**/*.json' } } },
sheets: { type: 'csv', tables: { budget: { file: 'data/budget.csv' } } },
rows: 'a.b' picks the array inside a JSON document. Look at one file before
writing SQL: nested values arrive as JSON text (json_extract, json_each),
CSV columns are numbers only when every value is. A column of whole numbers
is an INTEGER, so wins / games divides as integers — write
wins * 1.0 / games for a rate.
Data that has to be fetched — an API saved into SQLite, a nightly export — gets a collector beside the source, so it stays fresh without anyone remembering to run the script:
collectors: {
stocks: { run: 'uv run collector/collect.py', every: '1h', source: 'stocks' },
},
It runs in the workspace root with .env loaded (keys stay there), on its
schedule while dev runs, or now with pnpm exec open-dashboard collect stocks.
Write the collector to replace its output in one step (write a new file, then
rename) so a panel never reads half a database.
Over a json or csv source, a run that leaves a file unreadable or empties
one that had rows gets the old file put back and fails; list tables that may
turn empty for real (today's live game, say) in allowEmpty: ['live'].
Keep the file plain: import type and satisfies only — it is loaded by
Node's own TypeScript support, which does not run enums or decorators.
Check .gitignore contains .env. Add it if not.
pnpm add pg | mysql2 | mssql | oracledb | @duckdb/node-api | @clickhouse/client | @google-cloud/bigquery | snowflake-sdk
SQLite needs nothing (built into Node 22.13+).
pnpm exec open-dashboard sources # ✓ or ✗ with the driver's error
pnpm exec open-dashboard schema <name> # every table, column, key, row count
pnpm exec open-dashboard query --source <name> "SELECT 1 AS ok"
Fix failures with the table in references/engines.md.
The dev server picks up config and .env changes without a restart.
Summarise the schema in a few lines: the main tables, how they join, which
columns hold time, money and status, and the date range of the data. Name the
SQL dialect — dashboards for this source must be written in it (see
dashboard-authoring → references/sql-dialects.md). Then write
databases/<name>/database.md with what you found (the document-database
skill), and offer what to build: "I can make you a dashboard of X, Y, Z —
/create-dashboard."
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
PostgreSQL, SQLite, MySQL, SQL Server, Oracle, DuckDB, ClickHouse, BigQuery
npx claudepluginhub simonliu-ai-product/open-dashboard --plugin open-dashboard9 skills in this plugin
/apply-commentsUse this skill when the user has left notes on panels in the open-dashboard viewer and wants them applied — "apply my comments", "do the notes I left", "I marked up the dashboard". Walks every `@dashboard-comment` marker, makes the change each asks for, verifies it, and removes the marker./create-chartUse this skill when a dashboard needs a chart that none of the built-in panels draws — a radar, a bespoke gauge, a domain-specific diagram — and the user wants it written once under `charts/` and reused in dashboards. Also use it to fix or restyle an existing custom chart under `charts/`. Do NOT use it when a built-in panel fits (check `dashboard-authoring` → *Choosing a panel* first), for dashboards themselves (`create-dashboard`), or for colours and fonts across a dashboard (that is a theme in `themes/`)./create-dashboardUse this skill when the user wants a new dashboard, report, KPI board, or set of charts over their data in this open-dashboard workspace — "build me a sales dashboard", "I want to see signups per week and churn", "make a Grafana-style board for orders", "show me revenue by region", or anything that should land under `dashboards/`. Also use it to add several panels to an existing dashboard. Do NOT use for connecting a database (that is `connect-database`) or for editing the framework itself./create-themeUse this skill when the user wants dashboards to look different — brand colours, a company font, "red for up and green for down", softer corners, a darker page, "make the marketing dashboard match our deck" — or to change, rename or apply an existing theme under `themes/`. Covers writing `themes/<id>.json`, choosing which dashboards use it (`meta.theme`) and the workspace default (`theme` in the config). Do NOT use it for a chart that does not exist yet (`create-chart`), for a panel's layout or chart type (`dashboard-authoring`), or for what a chart shows./current-dashboardUse this skill to find out which dashboard, panel, and filter values the user is looking at in the open-dashboard viewer, so "this chart", "this dashboard", "the one I'm looking at", or an instruction with no dashboard named resolves without asking./dashboard-authoringTechnical reference for writing open-dashboard dashboards — the file contract, the named-query .sql format, parameters and filters, every panel component and its props, number formats, layout, and chart-choice rules. Use whenever writing or editing anything under `dashboards/<id>/` (index.tsx or .sql). The workflow for drafting a new dashboard from scratch is the `create-dashboard` skill.Other plugins' skills for the same job