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
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
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
SQLFluff is a multi-dialect SQL linter, formatter, and style guide enforcer. It functions as a parser and analyzer that converts SQL scripts into structured trees to validate syntax, identify logical components, and enforce consistent capitalization, aliasing, and layout conventions across various database dialects. The system is specifically designed to handle templated SQL, providing the ability to analyze, parse, and lint files containing macros or placeholders. It uses dummy-parameter rendering and source mapping to validate the style and correctness of dynamic code before it is rendered
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 main features of andialbrecht/sqlparse are: SQL Parsers, SQL Formatting, SQL Formatters, Script Splitting, SQL Statement Parsing, String Splitting, SQL Analysis and Linting, Formatting Automations.
Open-source alternatives to andialbrecht/sqlparse include: jdorn/sql-formatter — This project is a PHP library designed for parsing, beautifying, and syntax-highlighting SQL queries. It provides a… tobymao/sqlglot — sqlglot is a SQL parser and transpiler that represents queries as abstract syntax trees to enable structural analysis,… 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… analysis-tools-dev/static-analysis — This project is a comprehensive, curated directory of static analysis, linting, and security scanning utilities. It… jsqlparser/jsqlparser — JSqlParser is a Java library for SQL query parsing, converting raw SQL strings into a structured hierarchy of strongly…