🚀 Getting Started
- Paste or type your SQL query in the Input SQL area
- Click Format SQL to beautify your query
- Adjust formatting options in the toolbar above
- Copy the formatted result or download it as a file
⚙️ Formatting Options
- SQL Dialect: Choose your database type for optimized formatting
- Capitalization: Set keywords to UPPERCASE, lowercase, or Capitalize
- Indentation: Use spaces or tabs, and set the indent size (1-8)
- Comma Before: Place commas before column names (common in some styles)
- Align Columns: Align column names in SELECT statements
- Preserve Comments: Keep your SQL comments intact
- Remove Comments: Strip all comments from the query
✨ Features
- Syntax Highlighting: Color-coded SQL for better readability
- Validation: Check your SQL for common syntax errors
- Minify: Compress SQL for production use
- Batch Format: Format multiple queries separated by semicolons
- Undo/Redo: Navigate through formatting history
- Save Preferences: Your settings are saved automatically
📝 Supported SQL Statements
- SELECT queries with complex JOINs
- INSERT, UPDATE, DELETE statements
- Subqueries and nested queries
- CTEs (Common Table Expressions)
- UNION and UNION ALL operations
- CREATE, ALTER, DROP statements
🔧 Keyboard Shortcuts
Ctrl + Enter - Format SQL
Ctrl + Shift + M - Minify SQL
Ctrl + Z - Undo
Ctrl + Y - Redo
Ctrl + C - Copy formatted SQL
💡 Tips
- Use the "Load Sample" button to see formatting in action
- Validation checks for basic syntax, not semantic correctness
- Preferences are saved in your browser's localStorage
- For complex queries, try different SQL dialects
🔌 API Integration
Use the REST API endpoints to integrate SQL formatting into your applications:
// Format SQL
POST /api/format
{
"sql": "SELECT * FROM users",
"options": {
"keywordCase": "upper",
"indentSize": 4
}
}
// Validate SQL
POST /api/validate
{
"sql": "SELECT * FROM users",
"dialect": "mysql"
}