Console
About this console
The R2-query console runs SQL against Cloudflare R2 Data Catalog through the /api/query Pages Function. The bearer token stays server-side.
Shortcuts
⌘↵/Ctrl+↵— run the current query- Click a table name in the sidebar to insert
SELECT * FROM … - Save stores the query in this browser's
localStorage(per device, not synced)
Promoting a saved query to a dashboard
Move the SQL into evidence/sources/<group>/<name>.sql, then reference it from a Markdown page with an Evidence query block. See evidence/sources/README.md.
Heads-up: btc.transactions.inputs / outputs
These are LIST<STRUCT<...>> columns whose nested shape drifted across the source dataset's history (SegWit added txinwitness; the Genesis era lacked address in outputs). R2 SQL refuses to scan a parquet whose nested struct shape doesn't equal the iceberg declaration exactly in either direction, and no single iceberg shape matches every partition. The catalog uses the intersection of nested fields, which keeps non-nested projections universally queryable but means SELECT outputs FROM btc.transactions LIMIT 10 returns a 40004 Cannot cast column error. Workarounds:
- Project flat columns only:
SELECT txid, hash, fee, output_value, block_number FROM btc.transactions LIMIT 10 - Or pin a homogeneous date range where the physical struct matches the intersection (typically very early partitions).
