Convert SQL to CSV
Turn SQL files into CSV files. The tables the script creates are loaded first, with a dump from MySQL, MariaDB or PostgreSQL rewritten into SQLite's dialect.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop SQL files on the dialor turn it to pick what to do
One CSV file for every table in the script.Each table the SQL script creates becomes its own CSV with a header row.
What you get
One CSV per table, named after the table. Each file starts with a header row, followed by the rows of that table.
Values are written as stored. Binary values are written as escaped text.
How the script is read
The tables the script creates are loaded first, and the CSV files are made from them. A dump from MySQL, MariaDB or PostgreSQL is rewritten into SQLite's dialect as part of that step.
What changes or is left out
Dates that are not real dates, such as MySQL's 0000-00-00, are left empty. PostgreSQL true and false become 1 and 0.
Views, functions and triggers are left out, and a warning says so. Only tables are turned into CSV files.
To go the other way, use CSV to SQL.
SQL and CSV.What each format is.
The formats
SQL Script
SQL statements as text. A database dump that any SQL tool can read or replay.
- Extensions
- .sql
- MIME type
- application
/sql - Kind
- Text and data
CSV
Rows of comma-separated values. The plainest way to move a table between programs.
- Extensions
- .csv
- MIME type
- text
/csv - Kind
- Text and data
In your code.The same SQL to CSV conversion through the API, for your app or your agent.
$ cv convert report.sql report/ --to csv$ cv convert report.sql report/ --to csvQuestions.What people ask about SQL to CSV.
One CSV for each table in the script, named after the table. A script with several tables gives several files.
Yes. A dump from any of them is rewritten into SQLite's dialect before the tables are loaded.
They become 1 and 0 in the CSV.
No. Views, functions and triggers are left out with a warning. Only the tables become CSV files.