Data Export
Table of contents
Overview
Pharos offers three ways to get data out: copying results to the clipboard, exporting results to a file, and exporting an entire table from the schema browser. Copy and export operate on the current selection (cell range or rows) if one exists, otherwise on all displayed rows.
Copy to Clipboard
Cmd+C copies the selection as TSV. The Copy button in the action bar and the grid’s right-click menu offer all formats, with an Include Headers toggle (remembered between uses):
| Format | Description |
|---|---|
| TSV | Tab-separated values (the Cmd+C default) |
| CSV | Comma-separated values with proper escaping |
| Markdown | Markdown table with header and separator row |
| SQL INSERT | INSERT statements with type-aware value formatting |
| SQL WITH | CTE with a VALUES clause and type casting on the first row |
Menu labels adapt to the selection — “Copy selection as…” when cells or rows are selected, “Copy as…” otherwise. SQL INSERT output uses table_name as a placeholder and handles NULLs, numerics, and booleans unquoted, with strings single-quoted and escaped.
Every copy also places a plain TSV table and an HTML table on the clipboard alongside the chosen format, so pasting into a spreadsheet or a rich-text field lands as a table regardless of which format you picked.
Drag Out
Dragging a selection out of the grid carries the same three clipboard forms as a copy (TSV, a plain table, an HTML table) plus a CSV file promise, so a drop on the Finder writes a .csv while a drop into a text field pastes text. See Results Grid.
Export Results to File
The Export button in the action bar offers CSV, TSV, JSON (pretty-printed array of objects), SQL INSERT, and Markdown — each opens a save dialog.
Share… in the same menu writes the selection (or the whole result) to a CSV file and opens the system share sheet, so the file can go straight to Mail, Messages, AirDrop or any share extension you have installed.
When the result is showing as a chart, the same button switches to chart exports: Export Chart as PNG…, Export Chart as PDF…, and Copy Chart as Image.
Export a Table
Right-click a table, view, or partition in the Schema Browser and choose Export Data…. The table export sheet offers:
- Format — CSV, TSV, JSON, JSON Lines, SQL INSERT, Markdown, or Excel (XLSX)
- Include headers — toggle column headers
- NULL values — write nulls as an empty string or as
NULL - Columns — check or uncheck individual columns, with All/None buttons
JSON Lines and Excel (XLSX) are only available in the table export sheet — use it from the schema browser when you need those formats.
The sheet opens on what Settings ▸ Export & Import says: the default format, the header row, the NULL text and the folder the save panel starts in. Turn on Remember last choices there and the sheet writes your choices back after each export, so the next one opens where the last left off.
The CSV Dialect
Everything about the shape of a CSV file — the delimiter, the quote character, when fields are quoted, the NULL text and the encoding — is one set of settings in Settings ▸ Export & Import, shared by writing a file and reading one back. A file Pharos exported imports again without a second set of choices.
Leave the pane alone and an exported CSV is byte for byte the file earlier versions of Pharos wrote: comma-separated, "-quoted only where a field holds the delimiter, a quote or a line break, NULLs as empty fields, and plain UTF-8 with no byte-order mark.
Two encodings are worth knowing about:
- UTF-8 with BOM is what Excel on Windows expects. Without it, Excel reads accented characters as mojibake.
- Latin-1 cannot carry every character. Anything above U+00FF is written as
?, and the alert after the export says how many characters that happened to — so a lossy export tells you it was lossy instead of looking clean.
A TSV export always uses a tab, whatever the delimiter setting says.
Import a Table
Right-click a table in the Schema Browser and choose Import Data…, or drop a .csv file straight onto the table. The sheet asks for the file and whether it has a header row; the delimiter, quote character and NULL text come from the CSV dialect above.
An imported file that starts with a byte-order mark is read in the encoding that mark names, whatever the setting says — so a UTF-16 LE export goes straight back in.
Two settings decide what happens when the server refuses a row:
- When a row fails — Stop and undo everything is the long-standing behaviour: one bad row and the whole file is rolled back. Skip the row and carry on runs every row inside its own savepoint, so a bad row is undone on its own and the rest of the file still lands. The alert afterwards names how many rows were skipped and why, listing at most twenty reasons.
- Commit every — 0 is one transaction for the whole file. A number commits as the file is read, so the batches that finished stay on the server even if a later row stops the import.