Skip to the content
mantichora_/docs

Copying, dumps and loads

Rows moved between connections, a schema written to a file of SQL, a delimited file loaded into a table, and a table filled with rows made up for the purpose.

Copying rows to another table

Right-click a table and choose Copy rows to…: Into which connection, Into which schema and Into which table, then Copy. The table must exist already; the columns copied are those with the same name on both sides, the case of the name aside.

Before you press, the dialog says how it will go. On the server when both tables are on one connection: the server copies the rows itself. Over the wire between two connections: every row is read here and written there, up to 256 MB of values. If it fails part way, the target table is left as it was.

Dumping to a file

Dump, on a table, a schema or a database (in its right-click menu and on the tree’s toolbar), asks where to save, then writes one .sql file: the create statement of every table under it and all of its rows as INSERTs, whole tables whatever the page size. It counts tables, rows and bytes as it goes; cancelled, it writes nothing, and a file already under that name is as it was. Views, materialised views, foreign and partitioned tables are not dumped.

It is written for PostgreSQL, MySQL, SQLite, SQL Server, Oracle, SAP HANA, DuckDB, ClickHouse and Cassandra.

Loading a file

Right-click a table and choose Load a file into this table…. The file is delimited UTF-8 text, CSV and its kin, up to 256 MB.

  • Delimiter: comma, semicolon, tab or vertical bar, guessed from the first lines.
  • The first row is a header, or not.
  • An empty field means NULL or an empty string.
  • Which field of the file each column takes, beside the column’s type and the file’s first value; nothing leaves the column its default.

Load writes it in one transaction: stopped part way, nothing is loaded and the table stays as it was.

Filling a table with generated rows

Right-click a table and choose Fill this table with generated rows…. Say how many Rows, a thousand unless changed and at most a million; a Seed, so the same seed makes the same rows again; and what share are NULL. For each column choose what it holds:

Countingfrom a number, by a step
Whole number · Decimalbetween two bounds, with so many decimals
Date and timebetween two moments
Wordsso many words of text
One of thesepicked from a list you give
True or false · UUID · Always emptyas they say

Ten sample rows show what will be written. Columns the server fills itself are left to it. Generate asks once more, because nothing undoes it but a delete, and Write them writes them.