Database

SQL editor

Inspect your database with one read-only SQL statement at a time. The editor is for reading; schema changes go through the Database screens — tables, policies, functions, triggers, indexes, types, and views.

The limits

RuleValue
Statements per runExactly one
LengthAt most 8,000 characters
Allowed prefixesselect, with, explain, show, values, table
TransactionRead-only, on the SQL role
Statement timeout3 seconds
Rows returnedAt most 200; the response says when it was truncated

Useful queries

Count rows per plan
SELECT plan, count(*) AS customers
FROM public.customers
GROUP BY plan
ORDER BY customers DESC;
Inspect your end users
SELECT email, is_anonymous, email_verified_at, last_sign_in_at
FROM auth.users
ORDER BY created_at DESC
LIMIT 50;

The SQL role can read the managed auth and logs schemas, so the editor is also how you inspect users, sessions, and request logs. The vault schema is not readable from it.

The response shape

Result · trimmed
{
  "columns": ["plan", "customers"],
  "rows": [{ "plan": "pro", "customers": 2 }],
  "truncated": false,
  "rowCount": 2,
  "durationMs": 4,
  "readOnly": true,
  "maxRows": 200
}

Additional resources