---
title: "Query editor"
description: "Run SQL against a warehouse from the console or the CLI, as one of its users."
---

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

# Query editor

The warehouse's **Query** tab runs SQL as one of its users, with that user's password, which you type
each time. It needs `warehouse.warehouses.query`.

1. Open **Warehouse**, then the warehouse, then its **Query** tab.
2. Pick a user and type its password (the user's Secret is linked beside it), and pick a database.
3. Write a statement and choose **Run** (⌘/Ctrl+Enter).

The results show with the rows and bytes read and the time taken. **Cancel** stops a running query.

From the CLI:

```sh
ezgh warehouse query whs_4k2m9x0a7qpe --user app -e 'SELECT count() FROM events.page_views'
ezgh warehouse query whs_4k2m9x0a7qpe --database events --file report.sql -o json
```

`query` asks for the password without showing it, or reads it with `--password-stdin`. Ctrl-C cancels
the query.

If a query reaches the warehouse but its answer doesn't come back (a dropped connection, say), the
console and `ezgh` say so. Check whether it took effect, such as rows an `INSERT` added, before running
it again.

## Limits

| | |
| --- | --- |
| Results | The first 10,000 rows or 16 MiB, whichever comes first, marked as cut short |
| Time | 5 minutes per query |
| At once | 20 queries per warehouse; another is refused with `too_many_queries` until one ends |
| Format | The editor shows its own results: leave out a `FORMAT` clause |

For bigger results, connect a client ([Connect](/warehouse/connect)). Trails records that a query ran,
who ran it and how it ended, never the statement.

Source: https://docs.ezghcloud.com/warehouse/query-editor/index.mdx
