MySQL formatter
Paste a MySQL query, a seed file or an entry from the slow query log and make it readable: clauses on their own lines, consistent indentation and keywords in the case you choose.
MySQL syntax understood
- `Backtick` quoted names, and # comments as well as -- and /* */
- LIMIT, INSERT IGNORE, REPLACE INTO and ON DUPLICATE KEY UPDATE
- JSON paths such as doc->>'$.name' and JSON_EXTRACT, and user variables such as @n := @n + 1
- Optimizer hints (/*+ … */) and version comments (/*! … */), kept exactly as written
Slow query log entries
Paste an entry from the slow query log as it is: the # Time and # Query_time lines stay as comments, and the query under them is laid out clause by clause, so you can see what it filters, joins and sorts on.
Inserts with many rows
An INSERT with many rows puts each row of VALUES on its own line, which makes seed files and dumps easy to read, and to compare.
MariaDB
MariaDB has its own choice in the dialect list, for its additions such as RETURNING; everything above works the same.
Private: nothing is uploaded
Formatting, checking and comparing all happen in your browser. Your documents are saved in the browser's own storage on this computer, not on a server, so they never leave your device.
With your permission, we count anonymous visits (which pages and tools are used), never what you type. See Privacy.
Questions
Can I format a stored procedure?
Yes, without its DELIMITER lines: DELIMITER is a command of the mysql client, not SQL. The statements inside BEGIN … END are then laid out one by one.
Does it work for Aurora MySQL and PlanetScale?
Yes. They speak MySQL, so their SQL formats the same way.
Is my data uploaded anywhere?
Your documents aren't: everything runs in your browser, and they are saved on your computer, in the browser's storage for this site. With your permission we count anonymous visits, never their content.