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. Results are always saved as a full JSON row array.

Tips

  • Use LIMIT 1 to 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

userplansignupscountry
alice@example.comPro142US
bob@example.comEnterprise98DE
carol@example.comFree321FR
dan@example.comPro77UK
SQL query · 7di Docs