---
title: "SQL Editor and tables"
description: "Choose the right compute and database, execute queries and read console results."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.pgnext.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# SQL Editor and tables

Open your project and **SQL Editor**. Select the compute and database before writing a query. Check the project and branch names to avoid working on unintended data.

## Verify the session with a read-only query

```sql
SELECT current_database(), current_user, now();
```

Run it and read the result or error in the editor. If the compute is starting, wait for its state to settle before retrying. Query time and returned rows can be limited; displayed results are not necessarily the entire table.

## Read data and schemas

Open **Tables** and select a schema and table. Use the pagination and sorting controls offered by the UI. If a row count could not be read, do not interpret it as an empty table. Distinguish no rows, missing permission and a read error.

History and saved queries help you revisit work. Do not put passwords or tokens into SQL: query text may be stored in history. Exported data needs the same protection as the original data.

## Before running writes

Verify the database and the affected rows. Test on a dedicated branch when appropriate. Do not repeat a write just because the browser lost its response: inspect data state or history to establish the outcome first.

MCP has its own confirmation mechanism for SQL writes, DDL, multiple statements and statements it cannot confidently classify. That does not mean the SQL Editor uses the same confirmation dialogs. See [MCP](/integrations/mcp/).

Source: https://docs.pgnext.dev/guides/sql/index.mdx
