SQL query
Run any SQL query against your PostgreSQL database and display the result live. Ideal for surfacing business metrics, row counts, totals, or any data your database holds.
What it is for
Use SQL query widgets to pull live numbers from your database without writing a custom API. Track signups today, active subscriptions, error counts, revenue totals, anything a query can express. Results update on a schedule and can be visualized as text or charts.
How to add it
- Click + Add widget and select SQL query.
- Enter your PostgreSQL connection string.
- Write your query. The widget uses the first column of the first row as the displayed value.
- Save.
Configuration
| Field | Description |
|---|---|
| Label | Display name (e.g. "Active users today"). |
| Connection URL | PostgreSQL connection URL (postgres://user:pass@host:5432/dbname). |
| SQL Query | Any SELECT query. Results are always saved as a full JSON row array. |
Tips
- Use
LIMIT 1to keep queries fast when you only need a single value. - Avoid queries that take more than a few seconds; they will time out.
- Any column names you use become selectable as value keys in the display settings.
Display options
Results are always saved as structured data (a JSON array of rows), so every display type is available. Use Table to see all rows if your query returns a single row the table flips to a transposed layout showing each column as a labeled row. Use Chart, Bars, or Candlestick to plot a chosen column over time. Enable multi-series mode to overlay several columns on the same chart, or switch to All rows to track each row position as a separate series across snapshots. See Display types for the full reference.
Credit cost
0.02 credits per check
Chart
Active users
1420
Table
| user | plan | signups | country |
|---|---|---|---|
| alice@example.com | Pro | 142 | US |
| bob@example.com | Enterprise | 98 | DE |
| carol@example.com | Free | 321 | FR |
| dan@example.com | Pro | 77 | UK |