Copy and export data
Rows of any result can leave Ferris IDEA as text for another program: copied to the clipboard or written to a file, as CSV, JSON, SQL and seven other formats. Copy as and export: Works. Importing a file into a table is not built yet.
Formats
Section titled “Formats”| Format | Notes |
|---|---|
| TSV | the default for copying; NULL as \N |
| CSV | RFC 4180, CRLF line ends; NULL as an empty field, an empty string as "" |
| Pipe-separated | like CSV with | |
| Markdown | a table; numeric columns right-aligned |
| JSON | an array of objects; NULL as null; a repeated column name becomes name_2 |
| HTML table | |
| XML | |
| SQL INSERT | one statement per row, for the result’s table |
| SQL UPDATE | UPDATE … SET the other columns WHERE the key columns, one per row |
| WHERE clause | the selected rows as a condition, to paste into a query |
One header setting covers CSV, TSV, pipe-separated, Markdown and HTML; it is on by default.
Copy cells
Section titled “Copy cells”- Select cells in the grid: click, ⇧-click or ⇧ with the arrow keys for a rectangle, ⌘A for all.
- Choose the format in Copy as: TSV ▾ in the grid’s toolbar.
- Press ⌘C (CtrlC).
A single cell is copied as its plain value, whatever the format.
Export a result or a table
Section titled “Export a result or a table”- Run the query, or open the table with Edit Data.
- Click Export… in the grid’s toolbar, press ⌥⇧⌘E (CtrlAltShiftE), or choose Tools › Database › Export Data….
- Choose the format and whether to write a header.
- Choose the rows: the selection, the loaded rows, or, for a table opened with Edit Data, all rows
with the current
WHEREandORDER BY. - Choose the target: the clipboard, or a file (proposed as
<project>/<name>.<extension>). - Check the preview (the first 20 rows) and press ↩.
Without a result the dialog says “No result to export: run a query first”.
Export from MongoDB and Redis
Section titled “Export from MongoDB and Redis”A MongoDB result (all its pages) or a set of Redis keys exports as JSON, JSON Lines or CSV; see Database systems.
What is not there yet
Section titled “What is not there yet”- No data import. Loading a CSV or JSON file into a table is not built. Until it is, generate
INSERTstatements with another tool and run them in a console, or use the database’s own loader (COPYin PostgreSQL,LOAD DATAin MySQL) from a console. - No spreadsheet format (XLSX) and no scripted export formats.
- No transposed export: Transpose changes only the view.
To copy a table with its rows into another schema of the same database, use Copy Table (F5): Explore and change a schema.
For agents
Section titled “For agents”export_data exports every row of one reading statement as text (at most 5 MiB) and writes no
file; it needs the permission read-data on the connection.
export_dataExport all rows of one reading statement as csv (NULL = empty field, empty string = ""), tsv (NULL = \N), psv, json, markdown (numeric columns right-aligned), html, xml, sql-insert or sql-update (need table; sql-update uses key, default the first column) or where-clause.export_store_resultExport a MongoDB find/aggregate result (all pages) or Redis keys (names one per line; values read by type and bounded) as JSON, JSON Lines or CSV into a workspace file.
No tool matches. Try fewer words, or .