Skip to content
DataLayer
Data
On this page

SQL reference

The SQL Explorer, the API /query endpoint, notebooks, dashboards and the MCP run_sql tool all execute DuckDB SQL against the published warehouse snapshot.

What is allowed

  • Exactly one read-only statement: SELECT, WITH … SELECT, UNION, window functions, aggregates, QUALIFY, PIVOT.
  • Only the public tables listed in the data dictionary.
  • Standard scalar, date/time, string, list and aggregate functions.

What is rejected

  • Any write or DDL (INSERT, UPDATE, CREATE, COPY, ATTACH, SET, PRAGMA, INSTALL, LOAD, EXPORT …).
  • File, network and catalog access (read_csv, read_parquet, glob, http…, duckdb_*, getenv, path or URL literals …).
  • Row generators that can exhaust resources (range, generate_series, repeat).

Rejected queries return HTTP 400 with kind: "guard" and the reason.

Limits

FreeHolderPro
Rows returned1,00010,00050,000
Timeout10 s30 s60 s

Current values are on the tiers page. Results beyond the row limit are truncated and flagged with truncated: true.

How it is isolated

  1. Parser guard — the query is parsed with sqlglot; table and function allowlists are enforced on the syntax tree.
  2. Read-only snapshot — each query runs on an immutable snapshot that only contains public tables, with external access disabled and configuration locked.
  3. Single-use worker — every query runs in its own pre-forked process with OS limits on memory, CPU time and open files, and is killed at the timeout.
  4. Output caps — rows and bytes are capped.

Examples

Launches per hour by protocol:

SELECT date_trunc('hour', launch_ts) AS hour, protocol, count(*) AS launches
FROM tokens
WHERE launch_ts >= now() - INTERVAL 24 HOUR
GROUP BY ALL ORDER BY hour;

Fastest bonding-curve completions:

SELECT symbol, mint, seconds_to_complete, mc_at_complete_usd
FROM migrations
ORDER BY seconds_to_complete ASC
LIMIT 20;

Creators with at least three launches:

SELECT creator, launches, completed, completion_rate
FROM devs WHERE launches >= 3
ORDER BY completion_rate DESC, completed DESC
LIMIT 50;