Docs

SQL editor

Write and run SQL in the console: run, explain and dry-run modes, confirmations for changes, row limits and timeouts, saved, shared and private queries, templates, formatting and permissions.

Updated Nov 25, 2026
SQL editor with saved queries and the database treeSQL editor with saved queries and the database tree
SQL editor

The SQL editor runs SQL on your project's database as your team member account — with full access, like the service role key. Use it for exploring data, one-off fixes and trying schema changes before making them migrations.

#Run, Explain and Dry run

ModeDoesUse it for
RunExecutes the SQL. Statements that change data or schema, or several statements at once, ask you to confirm first.Real changes and queries.
ExplainShows the query plan without running the query.Seeing whether an index is used.
Dry runChecks and runs read-only SQL; statements that would change data or schema are not executed.Trying queries safely on production.

Press ⌘/Ctrl + Enter to run. To test a schema change without keeping it, use a migration Dry run, which runs it in a transaction that is rolled back (Migrations).

#Row limits and timeouts

  • A SELECT without LIMIT is limited automatically (the default row limit is in the toolbar); the result says when it was cut.
  • However large a result, the editor shows at most 5,000 rows of it; for a read statement (SELECT, WITH, VALUES, TABLE) your database sends at most one row more than that.
  • Long statements are cancelled by the statement timeout (Pooling and timeouts).
  • Large results are better exported than displayed — select and download.

#Saved queries

FolderWho sees it
PrivateOnly you.
Shared with teamEveryone in the organization who can open the project.
FavoritesYour starred queries, private or shared.
TemplatesReady-made queries (create a table, enable RLS, find slow queries…) to start from.

Format (⇧⌥F) tidies the SQL.

#The database tree and autocomplete

  • The Database tree beside the editor lists your schemas, their tables and columns. Click a name to insert it; the table menu writes Select first 100 rows, Count rows or an Insert template with every column for you, and Open in Table Editor jumps to the Table editor.
  • Tables outside public are written with their schema (billing.invoices), and names that need it are quoted ("Order", "select"), so the SQL it writes always runs.
  • Autocomplete suggests the tables and columns of the schema you are in.
  • The tree and autocomplete come from one schema snapshot that the console keeps in your browser and checks with the server on each visit, so they open at once and refresh as soon as the schema changes. It is cleared when you sign out.
  • Schemas Sovaria manages (sovaria_internal, sovaria_trash) aren't listed (Postgres in Sovaria).

#Schema changes from the SQL editor

A create, alter or drop you run here is applied at once and recorded in the project's migration history with the SQL you ran, so your team can see who changed what. It has no down SQL, so it can't be undone with one click.

To change the schema withYou get
The SQL editorFast; recorded, but no one-click undo.
Schema pages: Functions, Triggers, Indexes; the Table editorA form that shows the SQL and its undo; Check before applying; undo from Version history: see, undo and restore changes.
A migration file (Migrations)Reviewed in git, applied the same way to staging and production, with your own down SQL.

Open in SQL editor on a function, trigger or index opens its SQL in a new tab so you can adapt it. Nothing runs until you press Run.

#Who can run what

Read-only statements need database.read; anything that writes, changes the schema or has several statements needs database.write (Organizations, members and roles). Viewers can run read-only queries only.

#Coming from Firebase or Supabase?

PlatformWhat this is called there
SupabaseSupabase SQL Editor
SovariaSQL editor

Moving an existing app? Migrate from Supabase or Firebase imports users (with their passwords), data, files and rules.