/Docs
Dashboard
Widget

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

  1. Click + Add widget and select SQL query.
  2. Enter your PostgreSQL connection string.
  3. Write your query. The widget uses the first column of the first row as the displayed value.
  4. Save.

Configuration

FieldDescription
LabelDisplay name (e.g. "Active users today").
Connection URLPostgreSQL connection URL (postgres://user:pass@host:5432/dbname).
SQL QueryAny SELECT query. First column of first row is the displayed value.
Data typeSingle value (displays first column of first row) or Structured data (displays all rows as a table).

Tips

  • Use LIMIT 1 to keep queries fast.
  • For table-style output, the widget can display multi-row results in a table view.
  • Avoid queries that take more than a few seconds; they will time out.

Display options

Text, line chart (tracks the numeric value over time), bar chart, or table (multi-row results).

Credit cost

0.02 credits per check

Table

userplanmrr
alice@acme.comPro$420
bob@corp.ioEnterprise$1,200
carol@startup.coPro$420
dan@agency.devFree$0

09:18 PM · 1h · Top users by revenue

SQL Query

Chart

Active users

1420

09:18 PM · 1h

SQL Query

Value

Active users

1,420

09:18 PM · 1h

SQL Query