Export data
CSV, JSON, SQL inserts, and Excel from any result grid or full table.
For: analysts, developers, anyone who needs to hand data off.
QueryDeck exports from two places: a query result, and a full table. Both support the same four formats.
Export formats
| Format | Best for | Notes |
|---|---|---|
| CSV | Spreadsheets, Excel, Google Sheets | Configurable delimiter, quoting, header row |
| JSON | APIs, JavaScript tools, data pipelines | Array of objects, one per row |
| SQL | Database-to-database migration | INSERT statements with explicit columns |
| Excel (.xlsx) | Sharing with non-technical teammates | One sheet per result, types preserved |
Export from a query result
After running a query, the result grid has an Export button in the top-right of the result pane. Click it.
A sheet opens with format + options:
- Format — pick one of CSV, JSON, SQL, Excel.
- Rows to export —
All rows(re-runs the query withoutLIMIT),Visible rows(just what's loaded),Selected rows(the ones you've highlighted). - Format-specific options (see below).
Choose a destination, save. The file lands on disk and Finder opens to it.
Export a full table
In Table Mode, click Export in the table toolbar. Same sheet, same options, but All rows means the entire table — filters applied if any are active.
For very large tables (millions of rows), the export streams to disk as it reads from the database. Memory usage stays low. The progress bar tells you how many rows are done.
CSV options
| Option | Default | Notes |
|---|---|---|
| Delimiter | , | Use ; for European locales, \t for TSV |
| Quote character | " | Standard CSV quoting |
| Quote style | Minimal | Quote only when needed, or always quote |
| Header row | On | Include column names as the first line |
| NULL representation | empty | Or a literal string like NULL if your downstream tool needs it |
| Line ending | \n | Or \r\n for Windows compatibility |
| Encoding | UTF-8 | UTF-8 with BOM available for Excel compatibility |
JSON options
| Option | Default | Notes |
|---|---|---|
| Format | Array of objects | Or one object per line (newline-delimited JSON) for streaming |
| Indent | Pretty (2 spaces) | Or compact for minimal file size |
| NULL representation | null | Or omit the key entirely |
| Date format | ISO 8601 | Or Unix timestamp |
SQL options
| Option | Default | Notes |
|---|---|---|
| Statement type | INSERT | Or INSERT ... ON CONFLICT DO NOTHING for idempotent imports |
| Batch size | 100 rows per statement | Larger batches are faster but harder to debug |
| Table name | The source table | Override to retarget the inserts elsewhere |
| Include schema | Off | Prefix with public. or your schema name |
Excel options
| Option | Default | Notes |
|---|---|---|
| Sheet name | Result name or table name | |
| Number format | General | Or specify a format string per column |
| Date format | Locale default | |
| Boolean as | TRUE/FALSE | Or 1/0 |
Excel files preserve column types — booleans become real Excel booleans, dates become real Excel dates.
Copy as
For a single row or selection, you don't need a file. Right-click in the grid → Copy as:
| Copy as | What goes on the clipboard |
|---|---|
| Cell value | The raw value, no formatting |
| Tab-separated row | Paste straight into a spreadsheet |
| CSV line | Comma-separated, ready for a CSV file |
| JSON object | { "col1": "value1", "col2": 123 } |
| INSERT statement | INSERT INTO table (col1, col2) VALUES ('value1', 123); |
Cmd+Shift+C is the shortcut for "Copy as INSERT", the most common case during development.
Export pending changes as SQL
When you've edited rows in Table Mode but haven't committed yet, the pending changes bar has an Export to .sql button. The file contains the exact INSERT, UPDATE, DELETE statements that would run on commit.
Useful for:
- Running the same change on staging before committing on production.
- Code review with a teammate.
- Auditing what an edit session would change.
Limitations
- Excel has a hard cap of 1,048,576 rows per sheet. QueryDeck splits across sheets if you exceed it.
- SQL exports are not minified or escape-optimized. For very large data dumps, use
pg_dumpormysqldumpinstead. - Binary columns (
bytea, BLOB) are exported as base64 in JSON, as escaped strings in CSV, and asdecode('...', 'base64')in SQL.
What's next
- Inline edits with a diff preview when you want to change rows, not just read them
- Notebooks for shareable reports that combine SQL, prose, and result tables