SQL editor in the console

Free credit available Limited time

A SQL editor for PostgreSQL and ClickHouse, read-only by design.

Open a database, type a query and read the rows. Every statement is checked before it runs and runs as a read-only account, so nothing typed here can change your data. Nothing to install, no password to paste.

Managed PostgreSQL and ClickHouse One statement, 30 s, 1,000 rows CSV or JSON export Owners and admins
Replica on sample data

shop-db

PostgreSQL 17 · ap-south-1

Running

SQL Console

Read only

Run read-only queries (SELECT or EXPLAIN). A query stops at 30 seconds and returns up to 1,000 rows.

Ctrl Enter
Ready
Ln 1, Col 1 Spaces: 2 PostgreSQL

Results show here. Run a SELECT, WITH, VALUES, TABLE or EXPLAIN.

Try

A replica of the console's SQL tab with its own words and limits, running on sample data in your browser. Nothing you type here leaves the page. Pick a sample query or type your own: this page answers simple SELECTs on the sample tables, while your database answers any read.

What the SQL tab does

An editor that knows your tables.
Results you can take with you.

The SQL tab sits on every managed PostgreSQL and ClickHouse database page, beside Queries. It is built like a database IDE: line numbers, each engine's own highlighting, a status bar with the line and column, ⌘ or Ctrl + Enter to run and an editor you drag to any height.

Completion from your tables

Table and column names come from the database's own table list, each column with its type. Tab takes the suggestion and a name that needs quotes gets them: a table called Invoice goes in as "Invoice".

The failing part, underlined

When the database says no you get its own message and code with the line and column, plus PostgreSQL's hint and detail when it gives them. The part it stopped at is underlined in the editor.

Schema and tables beside you

Every table, view and materialized view by schema, with a row estimate. Open one to see its columns and types. Click a name to put it in at the cursor.

Results you can read

Each column's type sits under its name, NULL shows as NULL (never as an empty cell) and rows are numbered. Expand opens the grid at full height; Messages says how many rows and how long.

Copy as CSV, export CSV or JSON

Copy a result as CSV or download it as CSV or JSON, named after the database and the time. NULL and empty strings stay apart. In JSON, big ids and exact amounts keep every digit.

Your history, in your browser

The last 50 statements on each database, with what they returned and when. One click puts a statement back. History stays in this browser, never on our servers: 30 days at most, cleared when you sign out.

Read-only by mechanism

Three walls between a typo
and your data.

Many SQL editors can write and stay safe only while someone remembers a setting. This one cannot write: the guard is how it runs.

  1. 1

    Checked before it runs

    On PostgreSQL, PostgreSQL's own parser reads the statement first: exactly one statement and a read (SELECT, WITH, VALUES, TABLE or EXPLAIN). Writes, schema changes, row locks, SELECT INTO and functions that change settings are refused, with the line and column, before anything reaches your database. On ClickHouse the reads are SELECT, WITH, EXPLAIN, SHOW, DESCRIBE and EXISTS.

  2. 2

    Run as a read-only account

    The first run on a database sets up a read-only account just for the editor. Every statement runs as that account (on PostgreSQL inside a read-only transaction), so a read that tries to write is stopped by the database itself.

  3. 3

    Your SQL and rows are not kept

    The statement and its answer travel sealed between our platform and your database's server. Only the person who ran it sees the answer, once; then the statement and the rows are deleted. Statements never reach our logs. Catalogs that hold password hashes are refused by name.

What a write gets back

Not run

Only SELECT, WITH, VALUES, TABLE and EXPLAIN run here: this editor is read-only.
At line 1, column 1.

The refusal is the console's own sentence and points at where the statement starts. Nothing was sent to the database. Try it in the editor above with A write.

The limits, written down

Every limit,
before you hit it.

Most SQL editors do not say where they stop. These are the SQL tab's limits on every database, whatever its size.

Runs go to the primary, so a heavy query shares it with your app; the 30-second stop caps that. The tab works while the database is running and your organization has credit.

Statements per run
One
Reads on PostgreSQL
SELECT, WITH, VALUES, TABLE, EXPLAIN
Reads on ClickHouse
SELECT, WITH, EXPLAIN, SHOW, DESCRIBE, EXISTS
Time per statement
30 seconds, then the statement is stopped
Rows back
Up to 1,000 (fewer when rows are very wide)
Statement length
20,000 characters
Pace
60 runs per person every 10 minutes; one of yours at a time on a database, two from your whole team
Who
Owners and admins of the organization
Where it runs
The database's primary, while it is running
Price
No charge of its own: it runs on the database you already pay for

Two engines, one editor

Transactions and analytics.
The same tab on both.

Managed PostgreSQL
  • ✓Reads: SELECT, WITH, VALUES, TABLE and EXPLAIN
  • ✓Runs in the database your connection string names, else postgres; pick another from the list
  • ✓PostgreSQL's highlighting; names that need it go in double quotes
  • ✓Errors carry the SQLSTATE, the hint and the detail
Managed ClickHouse
  • ✓Reads: SELECT, WITH, EXPLAIN, SHOW, DESCRIBE and EXISTS
  • ✓Runs in default unless your connection names another database
  • ✓ClickHouse's own SQL: backtick names and # comments
  • ✓Errors carry ClickHouse's own number and words

When to use your own client

The SQL tab reads.
Everything else, your way.

For changes, connect with psql, DBeaver, your app or your migration tool, using the connection string and database users on the database's Connection tab. The SQL tab stays the quick, safe place to look.

  • →Writes and schema changes: INSERT, UPDATE, CREATE TABLE and your migrations
  • →The CREATE INDEX CONCURRENTLY statement Index Advisor hands you
  • →Exports bigger than 1,000 rows and reports that run past 30 seconds
  • →Engines without the tab: it is on PostgreSQL and ClickHouse

Frequently asked questions

Can the SQL editor change my data?
No. It runs one read per run: SELECT, WITH, VALUES, TABLE or EXPLAIN on PostgreSQL and SELECT, WITH, EXPLAIN, SHOW, DESCRIBE or EXISTS on ClickHouse. Anything else is refused before it reaches the database. Statements that pass run as a read-only account that Selfhost.dev sets up for the editor.
Which databases does it work with?
Managed PostgreSQL and managed ClickHouse on Selfhost.dev, from the SQL tab on each database's page. MySQL, Redis, OpenSearch and Kafka databases do not have the tab today.
Who can use it?
Owners and admins of the organization. Other roles do not see the tab and the backend refuses them as well.
What are the limits?
One statement per run, 30 seconds per statement, up to 1,000 rows back and statements up to 20,000 characters. Each person can run 60 statements every 10 minutes, one at a time on a database.
Can I export the results?
Yes. Copy a result as CSV or download it as CSV or JSON. NULL and empty strings stay apart in both. In JSON, large ids and exact amounts keep every digit.
Do you keep my queries or results?
No. The statement and its answer are encrypted on the way, delivered once to the person who ran it and then deleted. Statements never go into our logs. Your list of recent statements lives in your own browser.
Do I still need pgAdmin, DBeaver or psql?
For reading and checking, no: there is nothing to install and no password to paste. For writes, migrations, creating indexes and large exports, keep your own client and connect with the connection string from the database's Connection tab.
Does it cost anything?
There is no charge for the SQL tab itself. It runs on the database you already pay for by the hour. Like the rest of the console, it needs credit in your balance.

Your data, one query away.
Read-only from the first run.

$5 in free credit, no card needed.