Welcome to SQLFormatter
, a tool for standardizing and formatting SQL scripts comfortably. This application is compatible with MariaDB, MySQL, SQL Server, PostgreSQL, and SQLite.
SQLFormatter
is a tool designed to help developers standardize and format their SQL scripts with ease. It supports various SQL dialects and provides options for both minified and formatted output.
As already mentioned in the application, when you minify a script, both single-line and multi-line comments will be removed.
-
Access the application URL:
-
Paste your SQL script in the text area.
-
Select the desired format in the “Format Options” selector.
-
Click on the “Format the Script” button.
-
And volià! It's that simple.
Note: Optionally, you can copy the output to the clipboard by clicking the “Copy to Clipboard” button.
- React: A JavaScript library for building user interfaces.
- Vite: A fast build tool for modern web projects.
- Tailwind CSS: A utility-first CSS framework.
- Material Tailwind: Tailwind components library inspired by Material Design.
- sql-formatter: SQL Formatter is a JavaScript library for pretty-printing SQL queries.
- @heroicons/react: Beautiful hand-crafted SVG icons, by the makers of Tailwind CSS.
sqlformatter/
┣ public/
┃ ┣ assets/
┃ ┃ ┣ fonts/
┃ ┃ ┃ ┗ ...
┃ ┃ ┗ img/
┃ ┃ ┗ ...
┣ src/
┃ ┣ assets/
┃ ┣ components/
┃ ┃ ┣ FooterComponents/
┃ ┃ ┃ ┗ Copyright.jsx
┃ ┃ ┣ FormatterComponents/
┃ ┃ ┃ ┣ AlertMessage.jsx
┃ ┃ ┃ ┣ FormatOptions.jsx
┃ ┃ ┃ ┣ FormatterButtons.jsx
┃ ┃ ┃ ┗ ScriptTextarea.jsx
┃ ┃ ┣ Icons/
┃ ┃ ┃ ┣ AlertIcon.jsx
┃ ┃ ┃ ┣ CopyIcon.jsx
┃ ┃ ┃ ┣ GitHubIcon.jsx
┃ ┃ ┃ ┗ StartIcon.jsx
┃ ┃ ┣ Footer.jsx
┃ ┃ ┣ Formatter.jsx
┃ ┃ ┣ Header.jsx
┃ ┃ ┗ SocialLinks.jsx
┃ ┣ hooks/
┃ ┃ ┣ useCopy.js
┃ ┃ ┗ useFormat.js
┃ ┣ layouts/
┃ ┃ ┗ BaseLayout.jsx
┃ ┣ styles/
┃ ┃ ┣ components/
┃ ┃ ┃ ┣ footer.css
┃ ┃ ┃ ┣ formatter.css
┃ ┃ ┃ ┗ header.css
┃ ┃ ┗ global.css
┃ ┣ utils/
┃ ┃ ┗ MetaTags.jsx
┃ ┣ App.jsx
┃ ┣ consts.js
┃ ┗ main.jsx
┣ index.html
┗ ...
- public/: Contains static assets used in the application.
- src/: Main source code directory.
- components/: Contains reusable React components.
- hooks/: Custom React hooks for managing state and logic.
- layouts/: Layout components for different sections of the application.
- styles/: CSS files for styling components.
- utils/: Utility functions and components.
This project uses Tailwind CSS for styling. Global styles are defined in src/styles/global.css
, while component-specific styles are located in the src/styles/components
directory.
The Header component displays the title and description of the application.
The Formatter component provides options for formatting and minifying SQL scripts.
The Footer component contains copyright information.
- useCopy: Custom hook for handling script copying functionality.
- useFormat: Custom hook for formatting SQL scripts.
- MetaTags: Utility component for setting meta tags dynamically.
- consts.js: Contains site-wide constants such as the site title and description.
Contributions to this project are welcome! Feel free to fork the repository and submit a pull request. Please ensure your code follows the established conventions and passes all linting checks.
This project is licensed under the MIT License. See the LICENSE file for more details.
Happy SQL formatting! 🎉