Skip to content
Tinker
Download

Export, import and transfer

Rows are written as they arrive, so a large table never has to fit in memory.

⌘⌥E on any grid. Format, scope and the options that format needs, and nothing else.

Export

FormatOptions
CSVDelimiter, quote, header row, NULL representation, UTF-8 or UTF-8 with BOM for Excel.
JSON / NDJSONAn array of objects, or one object per line.
SQL INSERTBatch size, optional CREATE TABLE, the source dialect.
ExcelA streamed .xlsx workbook.

Scope is the selection, the loaded rows, or the entire table or query. The last re-executes the statement and streams straight to disk with a progress sheet you can cancel. Export runs off the main thread and writes through a buffered file handle.

Note
Text exports guard against spreadsheet formula injection: a cell that begins with =, +, -, @, tab or carriage return is prefixed so a spreadsheet shows it as text. The switch is on by default (ADR-0032).

Dump and import

Dump writes a database, a schema or a set of tables as SQL, structure and data or either alone, in the engine’s dialect. Import runs a SQL script, statement by statement through the same splitter the editor uses, and reports progress and any failure with the statement that caused it.

Import Data

A workbook of two sheets, open on the one that holds the orders. Each table column picks the file column that fills it, with a sample of what it will receive; the key is left to the server.

Import Data… — it used to be Import from CSV — reads CSV, TSV, Excel (.xlsx), JSON and JSON Lines into a table. The sheet names the file, the sheet of the workbook and the table, and each table column chooses the file column that fills it; Match by Name and Match by Position do the whole table at once. The file is mapped, not loaded: rows go in as they are read, with type coercion, and the rows that could not be coerced are shown rather than dropped.

  • Any sheet of a workbook can be imported, not only the first.
  • The encoding — UTF-8, UTF-16, Windows-1252, ISO-8859-1 — and the separator are read from the file and can be changed, so a CSV that Excel saved in UTF-16, or separated with semicolons, arrives as text rather than odd characters.
  • A number typed in Excel arrives as it was typed. Excel stores -8.59940239 as -8.5994023899999995; Tinker reads it back as the shortest decimal that is the same number. A workbook Tinker exported is left exactly as written, so a 29-digit numeric comes back digit for digit.
  • The sheet names a column that is NOT NULL, has no default and is not filled, before the server refuses the first row. An old .xls workbook, or any other binary file, is refused with a message asking for .xlsx rather than read as noise.

Transfer between databases

Transfer copies tables from one connection to another, including across engines, streaming rows through in batches. Across engines the table is rebuilt in the target’s own terms — its spelling of the types, defaults it can read, the primary key, the indexes and the foreign keys — and the rows travel as the target’s literals: a PostgreSQL array arrives as JSON, a zone offset as ±HH:MM. Data sync compares rows by primary key and generates the INSERT, UPDATE and DELETE statements that would make the target match; like structure sync it shows destructive statements separately. Neither ever holds a table in memory.

Careful
What is written in the source’s own SQL cannot cross: views, routines, triggers, check constraints, generated columns, partitioning and full-text indexes stay behind. The transfer names every one of them when it finishes, under “Left behind on the way across engines”, so nothing is assumed to have arrived.