Skip to content

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.

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.

  1. Select cells in the grid: click, ⇧-click or ⇧ with the arrow keys for a rectangle, ⌘A for all.
  2. Choose the format in Copy as: TSV ▾ in the grid’s toolbar.
  3. Press ⌘C (CtrlC).

A single cell is copied as its plain value, whatever the format.

  1. Run the query, or open the table with Edit Data.
  2. Click Export… in the grid’s toolbar, press ⌥⇧⌘E (CtrlAltShiftE), or choose Tools › Database › Export Data….
  3. Choose the format and whether to write a header.
  4. Choose the rows: the selection, the loaded rows, or, for a table opened with Edit Data, all rows with the current WHERE and ORDER BY.
  5. Choose the target: the clipboard, or a file (proposed as <project>/<name>.<extension>).
  6. Check the preview (the first 20 rows) and press ↩.

Without a result the dialog says “No result to export: run a query first”.

A MongoDB result (all its pages) or a set of Redis keys exports as JSON, JSON Lines or CSV; see Database systems.

  • No data import. Loading a CSV or JSON file into a table is not built. Until it is, generate INSERT statements with another tool and run them in a console, or use the database’s own loader (COPY in PostgreSQL, LOAD DATA in 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.

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_datareadssshdatabase-permissiontrusted-projectExport 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_resultchangeswritedatabase-permissiontrusted-projectExport 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.