MariaDB Formatter
Format MariaDB queries and scripts with MariaDB rules for backtick identifiers, backslash escapes, # comments, executable comments and DELIMITER blocks. Clauses such as ON DUPLICATE KEY UPDATE and RETURNING stay together, columns and conditions are indented and statements are separated by blank lines. Unclosed strings and parentheses are reported with line and column for faster reviews.
Frequently asked questions
How does this differ from the MySQL Formatter?
Both share the MySQL quoting and comment rules. The MariaDB Formatter also treats RETURNING, which MariaDB supports on INSERT, REPLACE and DELETE, as its own clause.
Which literals and identifiers are recognized?
Backtick identifiers, single and double quoted strings with backslash escapes, X'' and B'' literals, N'' national strings, charset introducers such as _utf8mb4'text' and @variables. Their content is never changed.
How are comments handled?
Hash comments (#), double dash comments (-- followed by a space) and block comments are kept. Executable comments that carry a version marker stay exactly as written.
Which clauses get their own line?
SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY and LIMIT start their own lines. ON DUPLICATE KEY UPDATE, LOCK IN SHARE MODE, FOR UPDATE and RETURNING are kept together as clauses as well.
Can I format stored procedures?
Yes. DELIMITER lines stay on their own lines, the custom delimiter ends each routine, and BEGIN and END blocks with IF, WHILE and LOOP are indented.
Does it change keyword case?
No. All keywords and names keep the case you wrote. Only whitespace and line breaks change.
What errors are detected?
Unclosed strings, quoted identifiers and block comments, and unbalanced parentheses are reported with line and column. Full grammar and schema checks are not part of the tool.
Can I choose the indentation?
Yes. Choose 2 or 4 spaces or tabs for each level of nesting. Short parenthesized lists stay inline.
How large can the input be?
Up to 1 MB per request and 128 KB per statement. That covers large dumps of procedures and views.
Is my SQL stored?
No. Queries are formatted in memory and returned straight away. They are never saved and only request sizes are logged.