Skip to content

PopSQL: limited support.

Migrate now →

Catalog, metrics and data quality

Describe columns, define a metric once, and test every run against freshness, null and uniqueness contracts.

Metrics

A metric is SQL with a name — "revenue", "active customers" — defined once. In any query, `{{metric:revenue}}` expands to the metric's SQL as a subquery, so a report, a dashboard and an ad-hoc query answer "what is revenue?" the same way. Limits: 3 metrics on Solo, 15 on Pro, 50 on Team, 500 on Business.

A metric cited in a query
SELECT region, SUM(amount) AS revenue
FROM ({{metric:gross_revenue}}) r
GROUP BY region

An unknown slug is a hard error at run time, not silence — a renamed metric breaks the query that cites it, on purpose.

Quality tests

Every query can carry tests that run on each execution — scheduled or manual — and record pass/fail with a message. A failing test with warning or critical severity raises the `data_quality.test_failed` event on outbound webhooks.

RuleWhat it checks
rows_gte / rows_lte / rows_eqrow count against a threshold
not_emptyat least one row
freshness_hoursthe newest value in a timestamp column is within N hours — the freshness SLA: "updates every hour, or alert"
no_nullsa column with no nulls
unique_cola column with no duplicates
custom_sqlyour own SQL that must return one truthy row