Real SQL, safe enough to hand to your analyst.

Join, group and window across your tables in plain SQL. Every query passes the same checks before it runs, and the row rules on each table still apply to whoever is asking. Save the good ones, and anyone who may read the tables can run them.

  • read-only
  • Postgres's own parser
  • saved with parameters
  • audited

Write it, save it, use it.

  1. 1Write

    The editor completes tables, columns, choice values and the join a reference gives. ⌘↵ runs it, and a refusal puts the cursor where the problem is.

  2. 2Save

    Give it a path, a description and typed parameters. It becomes a draft, then a file in your repository like any other resource.

  3. 3Use

    Put it on a dashboard, where filters fill its parameters by name, or run it by path over the API.

Six checks on every query.

Each one holds on its own, so a mistake in one doesn't open the others. Each is tested against the ways people try to get around it.

CheckWhat it means
ParsedRead by Postgres's own parser and written again from what was read. One SELECT, with joins, CTEs, set operations, subqueries and window functions. Nothing that writes, locks or selects into.
AllowedOnly functions on a list: aggregates, dates, text, maths, JSON and windows. Settings, sleeps, the system catalog and links to other databases are not on it.
ViewsA query reads views of your tables, named by their paths, so each table's row rule still applies and retired columns aren't there.
PermissionEvery table named is checked against the person asking before anything runs. A refusal names the table.
IdentityWho is asking is signed, so even a query that reached a setting couldn't claim to be someone else.
LimitsA read-only transaction, 15 seconds unless the operator sets otherwise, a thousand rows by default and at most 5 MB back. A result cut short says so.

One query, each person's own answer.

A saved query runs as whoever runs it. A practice manager sees every clinic; the front desk at one clinic sees only theirs. Same text, same dashboard, no second version to keep.

  • Running a saved query needs read access to its tables, not permission to write SQL.
  • Over a table kept to each row's owner, everyone gets their own rows.
  • Parameters are bound, never pasted in, so text typed into a filter is a value that matches nothing, not SQL.

A saved query is a file.

Reviewed, deployed and promoted with the rest of your work, in TypeScript or YAML, whichever your team keeps.

  • Tables are named by their paths, in double quotes when a path has a slash or a hyphen.
  • Parameters are $1, $2 and so on, each with a type, a label and a default.
  • Two columns of the same name come back as one, so a join names them apart with AS.
platform/reports/loans-by-month.query.yamlquery
# The desk sees every loan, and a student their own.
schemaVersion: 1
body:
  description: Loans by month and kind, from a date on
  sql: |
    select date_trunc('month', l.checked_out_at) as month,
           l.kind, count(*) as loans,
           count(*) filter (where l.status = 'out') as still_out
    from loans l
    where l.checked_out_at >= $1::date
    group by 1, 2 order by 1 desc, 2
  parameters:
    - { name: since, type: date, label: From, default: "2026-01-01" }

From the higher-education example.

Who writes, who reads, what's kept.

Writing SQL is its own permission
Given by name to tenant admins, workspace admins and developers. A viewer who may read everything still can't write SQL until someone grants it.
Every run in the audit log
With its text, the tables it read and how many rows came back. Never the rows themselves.
Renames don't break dashboards
The old path answers for 90 days, and after that the dashboard still finds the query by its key. Dashboards made in the console are updated as drafts for you.
No SQL needed to start
A dashboard's visual builder writes the SQL from menus and runs it through the same checks. Turn it into SQL when you outgrow it.
Outside Postgres databases
Connect an existing database to browse its tables in the console and read or write them from scripts. SQL queries read the workspace's own tables, where row rules apply.
Never a write
Changes go through the row API, which checks types and fills in each row's owner. SQL here only asks.

Ask your data a real question.

Joins, windows and CTEs, with the same rules on every table.