Long single-line queries copied from application logs, slow-query monitors, or ORM debug output (such as Prisma, Hibernate, or TypeORM) are difficult to inspect. Built on sql-formatter, this utility tokenizes ISO/IEC 9075 SQL statements and dialect extensions in your browser. Given an unformatted query:
SELECT u.id, u.email, COUNT(o.id) AS order_count FROM users u LEFT JOIN orders o ON u.id = o.user_id WHERE u.active = 1 GROUP BY u.id, u.email ORDER BY order_count DESC;
sql-formatter restructures it into aligned clause blocks:
SELECT
u.id,
u.email,
COUNT(o.id) AS order_count
FROM
users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE
u.active = 1
GROUP BY
u.id,
u.email
ORDER BY
order_count DESC;
Selecting the matching dialect ensures dialect-specific identifier quoting ("column", `column`, or [column]) and bound parameter tokens ($1, :name, @param, or ?) are tokenized and aligned cleanly.