awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
jdorn avatar

jdorn/sql-formatter

0
View on GitHub↗
3,857 stars·184 forks·HTML·MIT·10 viewsjdorn.github.com/sql-formatter↗

Sql Formatter

This project is a PHP library designed for parsing, beautifying, and syntax-highlighting SQL queries. It provides a set of utilities to improve the readability of database code, facilitate debugging, and assist in the maintenance of complex query structures.

The library distinguishes itself by offering both aesthetic and functional processing capabilities. It can transform raw SQL strings into structured, indented formats for human review, or compress them by removing comments and unnecessary whitespace to optimize them for network transmission and logging. Additionally, it includes a syntax highlighter that injects markup into tokens, allowing for color-coded visual representation of database logic.

Beyond formatting, the tool functions as a query parser capable of splitting batches of database commands into individual, executable statements. It handles these tasks through a state-machine parsing model that tracks query context, such as nested structures and parentheses, ensuring that the original logic remains intact while the string is processed.

Features

  • SQL Formatters - Provides a comprehensive PHP library for beautifying, compressing, and syntax highlighting SQL queries.
  • SQL Parsers - Parses SQL strings to split batches into individual statements and strip comments for cleaner execution.
  • Context-Aware State Parsers - Tracks query context and nested structures using a state-machine model to ensure logic remains intact during processing.
  • Delimiter-Aware Batch Splitters - Splits batches of database commands into individual, executable statements by identifying termination characters.
  • Database Query Optimizations - Optimizes SQL queries by removing unnecessary whitespace and comments to reduce payload size for transmission.
  • Query Readability Formatters - Improves the visual structure of complex database queries through automatic indentation and formatting.
  • Query Compression Utilities - Compresses database queries by removing comments and unnecessary whitespace for efficient network transmission.
  • SQL Statement Parsing - Splits SQL batches into individual queries by parsing strings based on specific delimiters.
  • Batch Statement Execution - Parses multi-statement SQL strings into individual commands to simplify the management of complex migration scripts.
  • Regex Token Stream Lexers - Processes raw SQL strings into typed token sequences using regex patterns for keywords, operators, and identifiers.
  • SQL Syntax Highlighting - Applies color-coded formatting to SQL queries to make complex logic easier to scan and troubleshoot.
  • String Manipulation - Formats SQL queries for readability.

Star history

Star history chart for jdorn/sql-formatterStar history chart for jdorn/sql-formatter

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Sql Formatter

Similar open-source projects, ranked by how many features they share with Sql Formatter.
  • andialbrecht/sqlparseandialbrecht avatar

    andialbrecht/sqlparse

    4,008View on GitHub↗

    sqlparse is a Python library for the programmatic analysis and manipulation of SQL statements. It provides a non-validating parser that breaks down SQL text into tokens and a utility to divide strings containing multiple queries into individual statements. The project includes a code formatter that reorganizes SQL statements using consistent indentation and keyword casing. It also provides mechanisms for automating this formatting and linting process through version control hooks to maintain code consistency.

    Python
    View on GitHub↗4,008
  • tobymao/sqlglottobymao avatar

    tobymao/sqlglot

    9,336View on GitHub↗

    sqlglot is a SQL parser and transpiler that represents queries as abstract syntax trees to enable structural analysis, modification, and semantic transformation. It functions as a dialect translator and query optimizer, converting SQL code between different database engines and simplifying syntax trees through rule-based normalization. The project provides a framework for defining custom SQL dialects by overriding tokenizers, parsers, and generators. It includes a lineage analyzer to track data flow from source tables through complex queries to identify the origin of specific columns. Additi

    Python
    View on GitHub↗9,336
  • analysis-tools-dev/static-analysisanalysis-tools-dev avatar

    analysis-tools-dev/static-analysis

    14,389View on GitHub↗

    This project is a comprehensive, curated directory of static analysis, linting, and security scanning utilities. It serves as a central resource for developers to discover, compare, and select tools based on specific programming languages, licensing models, and integration requirements. The directory distinguishes itself by providing deep metadata for each listed utility, including community-driven popularity rankings, maintenance status, and deployment methods. By aggregating these tools into a single searchable index, it enables teams to identify solutions for enforcing coding standards, ma

    Rustanalysisawesome-listcode-quality
    View on GitHub↗14,389
  • jooq/jooqjOOQ avatar

    jOOQ/jOOQ

    6,666View on GitHub↗

    jOOQ is a type-safe SQL query builder for Java that generates code from live database schemas, enabling compile-time validation of SQL syntax and data types. Its core identity is built around a fluent DSL that mirrors SQL structure, a code generator that maps tables, views, and routines to Java objects, and a multi-dialect engine that translates the same DSL into vendor-specific SQL for over 30 databases. The project also includes a SQL parser and transformer for refactoring or dialect conversion, reactive stream integration for non-blocking query execution, and a JDBC proxy diagnostics tool f

    Javacode-generatordatabasedb2
    View on GitHub↗6,666
See all 30 alternatives to Sql Formatter→

Frequently asked questions

What does jdorn/sql-formatter do?

This project is a PHP library designed for parsing, beautifying, and syntax-highlighting SQL queries. It provides a set of utilities to improve the readability of database code, facilitate debugging, and assist in the maintenance of complex query structures.

What are the main features of jdorn/sql-formatter?

The main features of jdorn/sql-formatter are: SQL Formatters, SQL Parsers, Context-Aware State Parsers, Delimiter-Aware Batch Splitters, Database Query Optimizations, Query Readability Formatters, Query Compression Utilities, SQL Statement Parsing.

What are some open-source alternatives to jdorn/sql-formatter?

Open-source alternatives to jdorn/sql-formatter include: andialbrecht/sqlparse — sqlparse is a Python library for the programmatic analysis and manipulation of SQL statements. It provides a… tobymao/sqlglot — sqlglot is a SQL parser and transpiler that represents queries as abstract syntax trees to enable structural analysis,… analysis-tools-dev/static-analysis — This project is a comprehensive, curated directory of static analysis, linting, and security scanning utilities. It… jooq/jooq — jOOQ is a type-safe SQL query builder for Java that generates code from live database schemas, enabling compile-time… sqlfluff/sqlfluff — SQLFluff is a multi-dialect SQL linter, formatter, and style guide enforcer. It functions as a parser and analyzer… barryvdh/laravel-debugbar — Laravel Debugbar is a web-based debugging toolbar and application profiler for Laravel. It provides a visual interface…