Which SQL dialects are supported?
It supports standard ANSI SQL, MySQL, PostgreSQL, MariaDB, Oracle SQL, Microsoft SQL Server (T-SQL), and SQLite syntax structures. The underlying sql-formatter library recognizes dialect-specific keywords and functions, such as MySQL's GROUP_CONCAT, PostgreSQL's RETURNING clause, and T-SQL's TOP and NOLOCK hints.
Does this formatter alter the query execution logic?
No. It only adjusts whitespace, indentation, line breaks, and keyword casing without modifying aliases, table references, operators, or condition semantics. The formatted SQL is semantically identical to the original and can be executed directly in any SQL console.
How do I format a SQL query with subqueries or CTEs?
Paste the full query including WITH clauses (CTEs) and nested subqueries. The formatter handles multiple levels of nesting by indenting each subquery relative to its parent clause. Common Table Expressions (WITH ... AS) are placed on their own lines with proper indentation for maximum readability.
What is SQL Minify and when should I use it?
SQL Minify compresses a multi-line formatted query into a single line by removing all unnecessary whitespace and line breaks. This is useful for embedding SQL in configuration files, log entries, application properties, or situations where you need a compact representation without affecting the query logic.
Why is consistent SQL formatting important for teams?
Consistent SQL formatting reduces cognitive load during code reviews, makes version control diffs cleaner and more meaningful, and helps identify logical errors in complex JOIN chains or nested subqueries. Standardized keyword casing (all caps or lowercase) prevents inconsistency across team members and languages.
Can I format stored procedures and DDL statements?
Yes. The formatter handles DDL statements (CREATE TABLE, ALTER TABLE, DROP INDEX), DML statements (INSERT, UPDATE, DELETE), and stored procedure bodies. CREATE PROCEDURE, BEGIN/END blocks, and DECLARE statements are all formatted with proper indentation.
Is it safe to format SQL queries containing sensitive database credentials or schema names?
Yes, completely safe. All formatting runs inside your browser memory using a JavaScript SQL tokenizer. No query data is ever transmitted to any server or logged anywhere. You can safely format production queries containing real table names, column names, and schema structures.