Export Sequel Pro results to CSV

How exporting Sequel Pro query results to CSV works, what the export settings change, and how to keep the file readable in spreadsheets and other tools.

Sequel Pro is a macOS client for MySQL. One of its most common uses is getting a table or query result out of the database and into a CSV file for a spreadsheet, a report, or another system. This review covers when CSV is the right choice, what the conversion does to your data, and where problems tend to appear after the file is shared. No version-specific test results or measurements were available for this article. Menu names and defaults described here are general, so check them against the build you have installed.

Is CSV the right format for your export?

For most hand-offs, yes. CSV is plain text. Almost every spreadsheet, database import tool and scripting language can read it. The structure is easy to inspect, and query results map naturally onto its rows and columns.

The main tradeoff is that CSV keeps values but drops their types. A column that was an integer, a date or a fixed-width code becomes text in the file, and whatever opens the file decides how to read it again. Spreadsheets in particular may convert values automatically, and those conversions can change the meaning of the data.

Other formats are a better fit in some cases:

  • Use a SQL dump or INSERT statements if the data is going back into MySQL and column types, NULLs and character sets must survive exactly.
  • Use tab-separated output if the values often contain commas and the destination accepts TSV. Tabs rarely appear inside data, so less quoting is needed.
  • Use a simple pasted table or plain text if a person only needs to read a few rows. A file adds steps without adding value.

What the export actually changes

Exporting to CSV serializes rows into delimited text. It does not change the stored data in your database. The values themselves are mostly copied as they are, but several settings decide how they are written to the file. Sequel Pro's export dialog generally exposes these settings. Labels and defaults may differ between versions, and between Sequel Pro and its community-maintained successor, Sequel Ace.

Setting | What it controls | Why it matters
Field delimiter | Character placed between values, usually a comma | It must match what the destination expects. Some regional spreadsheet settings expect semicolons.
Enclosure | Character wrapped around values, usually a double quote | It protects values that contain the delimiter or line breaks.
Escape character | How an enclosure character inside a value is written | Common conventions are a doubled quote or a backslash. A mismatch with the reader corrupts fields.
Line terminator | Characters ending each row (LF or CRLF) | Some importers are strict about this.
NULL representation | What a database NULL becomes in the file | An empty string and a literal word such as NULL look different to importers. Without a distinct marker, NULL and empty text become impossible to tell apart.
Column names in first row | Whether a header row is written | Most spreadsheet and import workflows expect a header.
Encoding | Character encoding of the file | It must match the destination, or non-ASCII text will be garbled.

Here is an illustrative example of standard quoting, following the common RFC 4180 convention of doubling embedded quotes. It was not produced by a captured Sequel Pro export.

id,name,note
1,Acme,"Ships to Portland, OR"
2,"Smith ""Bob"" Ltd",
3,Café Nord,"Line one
Line two"

Each row in the example shows a different case:

  • Row 1: the comma inside the note is protected by quotes.
  • Row 2: the embedded quotes are doubled. The trailing empty field is ambiguous unless NULLs are exported with a distinct marker.
  • Row 3: the line break inside a quoted field is legal CSV, but simple line-by-line tools will split it.
  • The accented character in Café only survives if the file's encoding matches what the reader assumes.

There are several ways to choose what gets exported. Sequel Pro's export workflow is generally described as letting you export whole tables, the current query result, or filtered content. Confirm which source is selected before you export, because a table export and a query export can produce very different files. Outside the GUI, MySQL's SELECT ... INTO OUTFILE statement writes delimited files directly. It writes the file on the database server's filesystem, not on your Mac, and requires the FILE privilege. The mysql command-line client in batch mode produces tab-separated output.

Will the file stay readable and usable after sharing?

The CSV itself is durable plain text. The risks mostly come from the program that opens it.

  • Spreadsheet type guessing: spreadsheets commonly strip leading zeros from codes such as ZIP codes, display long numeric IDs in scientific notation, and reinterpret date-like strings. If precision matters, use the spreadsheet's import wizard and set those columns to text, instead of opening the file directly.
  • Encoding: a UTF-8 file without a byte order mark may display accented or non-Latin characters incorrectly in some spreadsheet versions. Check how your target application handles UTF-8 before assuming the export is broken.
  • Delimiter mismatch: in locales that use a comma as the decimal separator, spreadsheets may expect semicolon-delimited files. A comma-delimited file can then open as a single column.
  • Copy and paste: copying a result grid usually produces tab-separated text, which most spreadsheets split into cells on paste. This depends on the destination, so test with your own data rather than assuming it.
  • Re-saving: opening and re-saving a CSV in a spreadsheet can silently rewrite values, such as dates and trimmed zeros. Keep the original export if the file will later be re-imported.

Accessibility, search and editing generally work well. A CSV has no visual styling, so screen readers and search tools read the actual characters. Accessibility in practice depends on the application used to view the file. No assistive-technology test was available for this article, so check with the reader's actual software if that matters. CSV can be edited in any text editor, but hand edits that break the quoting will shift columns for every row that follows.

Bottom line

CSV export from Sequel Pro suits moving query results into spreadsheets, reports and import pipelines, as long as you deliberately set the delimiter, quoting, NULL marker and encoding. It is a poor choice when exact types or NULL distinctions must round-trip into a database. In that case, a SQL export is safer. For a quick look at a few rows, plain pasted text is simpler. Before you share the file widely, open a sample in the actual destination and check for leading zeros, long IDs, dates, accented characters and multi-line fields.