Guide · Doing
Export
Read this when rows need to leave Seqora: for a spreadsheet, a fixture file, a pull request or a message to a colleague. It lists what exists, and near the end what doesn't, so you don't go looking for it.
From a query result
- Run the query. With several result sets, pick one in the
Result setgroup. - Open the grid's more menu and click
Export rows…. - The
Export rowspanel says what it has:10,000 loaded rows, or312 of 10,000 loaded rows, filteredwhen the grid filter is on. - Under
Save as, clickCSV,JSONorSQL INSERT statements, and choose where to save.
The panel reports "Exported 10,000 rows to orders.csv." The word that matters is loaded.
Seqora exports the rows it holds, which is at most Rows kept per result, and the banner over
a cut result already told you how many more there were. Nothing is re-run.
CSV writes NULL as \N. JSON keeps numbers exactly as the server sent them, so a numeric
or bigint doesn't lose digits, and duplicate column names get numbered suffixes.
From a table tab
- Open
commerce.orders. - Type a filter into
Filter rows, for exampletotal_cents >= 100000. - Open the toolbar's more menu and click
Export rows…. - Under
Rows, chooseAll matching rows(All rowswhen no filter is on) orLoaded matching rows. Each shows its count. - Under
Save as, clickCSV,JSONorSQL INSERT statements.
All rows and All matching rows read the whole table page by page, with your filter and sort
applied. It is the one export that goes past the rows Seqora has already loaded.
SQL INSERT statements writes INSERT INTO commerce.orders ..., one per row.
The panel lists what the file will and won't hold: Only rows matching the filter, and
9 of 12 columns, in grid order; 3 hidden columns are left out. Hide a column before you
export and it stays out of the file.
The same Export rows… item is in a query result's more menu, where it exports the loaded rows
and names the table query_result in the INSERTs.
To the clipboard
- Select the rows or cells.
- Open
Copy as…from the grid's more menu or the row's right-click menu. - Pick
TSV,CSV,JSON,Markdown,SQL valuesorINSERT statements.
Headers adds the column names. NULL chooses whether a null is copied as NULL or Empty.
Plain ⌘C or Ctrl+C copies in the format set in Settings › Data Grid › Copy rows as, with
Include column headers and Copy NULL as beside it. A single cell is copied as it is. In
Tab-separated, a value holding a tab or a line break is quoted, so it lands in one spreadsheet
cell. Markdown is the one to paste into a pull request.
The ER diagram
- Open the diagram with
⇧⌘EorCtrl+Shift+E. - Click
Exportin its toolbar.Export diagramopens on what the canvas showed, with a frame around it. - Choose a
Format:PNG,SVGorMermaid. - Drag the frame's handles until it holds the tables you want. Its tab shows the image size.
- Click
Save…, orCopy.
The preview pans and zooms like the canvas. Zooming it doesn't change the image. Drag the
frame's tab to move it, or Shift-drag anywhere to draw a new one. Fit frame, Everything
and Canvas view in the toolbar under the preview reset the view or the frame. A table that
only partly fits is cut at the frame's edge, and its lines run to the edge.
Click a table in the preview to leave it out of the image. Show all brings them back.
Tables narrows the export to Selection, the selected table and the tables it links to.
Columns is As on canvas by default: the image has the same columns and positions as the
canvas, moved tables included. Keys only and All columns lay the tables out afresh. For PNG
and SVG you also get Theme, Aspect from Free to A4 portrait, Padding, and Include
with Transparent, Legend and Name & date. PNG adds Size: 1× to 4× scale, or a
width such as 1,920 px. Mermaid lists the tables inside the frame, has a Markdown fence
toggle, and pasted into a GitHub or GitLab pull request it renders as a diagram. ⇧⌘C or
Ctrl+Shift+C copies what the canvas shows as an image without opening the dialog.
Diagram export is Free on every engine.
A schema design
In Design a schema change, Copy SQL in the SQL pane
copies the script at any point. After an apply, Save as .sql writes it to your SQL folder. The
design's Export adds a Show choice of Changes, After or Before, Changes under Tables, and
for Mermaid a PR summary: "The diagram, the list of changes, and the SQL".
What is not there
- No full export of a query result. You get the loaded rows and no more.
- No XLSX. Excel and Numbers open the CSV.
- No Markdown file. Markdown is a clipboard format only.
For a result bigger than the cap, raise Rows kept per result to 100,000 in Settings ›
Connections and Safety, and run it again. Past that, let the server write the file. From
the terminal, which Ctrl+` opens:
psql "$DATABASE_URL" -c "\copy (SELECT * FROM commerce.orders WHERE placed_at >= now() - interval '30 days') TO 'orders.csv' WITH (FORMAT csv, HEADER)"
\copy runs on your machine and needs no server file privileges. COPY ... TO '/path' in the
editor writes on the database server's disk instead, and Seqora asks before it runs.
Caveats
- PostgreSQL's
COPY ... WITH (FORMAT csv)reads an empty field asNULL, not\N. Load a Seqora CSV withNULL '\N'. MySQL'sLOAD DATAreads\NasNULLalready. - A spreadsheet shows
\Nas text. Copy withCopy NULL asset toEmptyif that matters. All rowsandAll matching rowsfetch page after page as separate queries. A table with a key, or a keyless one up to 100,000 rows, is paged in a stable order. A larger keyless table is read in the server's scan order, and the panel warns that the file can repeat or miss rows if that order changes during the export.- A result with values the run could not read refuses to export: "3 values could not be read, so the export would write placeholders instead of data. Hide that column or re-run the query." Hide the column and the rest exports.