Run SQL Query
run_queryRun read-only SQL queries on your scoped data to summarize activity, find records by content, or build reports.
Instructions
Run read-only SQL over YOUR scoped data (panes, records, events) — the relay scopes every row to panes you own. Use it to summarise activity, find panes/records by content, or build a report. Tables + columns and JSON projection operators are documented on the sql parameter. Default output is { columns, rows, truncated, scope, elapsed_ms } (format:json); csv/tsv/table render the rows as text. Capped at 10,000 rows; 10s timeout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | Read-only SQL (SELECT/WITH/SHOW/DESCRIBE/EXPLAIN/PRAGMA) over your scoped data. Tables: panes(id,title,template_id,template_version,status,created_at,expires_at,deleted_at,metadata,input_data), records(id,pane_id,collection,key,data,version,seq,author_kind,author_id,created_at,updated_at,deleted_at), events(id,pane_id,type,ts,author_kind,author_id,data,template_version_id). `data` is JSON — project with ->> / ->. Capped at 10k rows; 10s timeout. | |
| format | No | Output format. Default json (columns+rows+meta). csv/tsv/table render the rows as text. | |
| pane_id | No | Scope the query to a single pane (resolves a view_conflict when two of your panes share a collection name with different schemas). |