awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
andialbrecht avatar

andialbrecht/sqlparse

0
View on GitHub↗
4,008 星标·728 分支·Python·BSD-3-Clause·5 次浏览

Sqlparse

sqlparse 是一个用于 SQL 语句程序化分析和操作的 Python 库。它提供了一个非验证解析器,将 SQL 文本分解为标记,并提供了一个将包含多个查询的字符串划分为单个语句的实用程序。

该项目包括一个代码格式化程序,使用一致的缩进和关键字大小写来重组 SQL 语句。它还提供了通过版本控制钩子自动化此格式化和 Linting 过程的机制,以保持代码一致性。

Features

  • SQL Parsers - Provides a non-validating Python library for breaking down SQL statements into tokens for analysis.
  • SQL Formatting - Offers utilities for pretty-printing and beautifying SQL code via consistent indentation and casing.
  • SQL Formatters - Reorganizes SQL statements with consistent indentation and keyword casing to improve readability.
  • Script Splitting - Divides large strings of multiple SQL commands into individual statements for sequential execution.
  • SQL Statement Parsing - Identifies and groups SQL statements based on delimiters to split complex scripts into individual queries.
  • String Splitting - Dividing strings containing multiple SQL queries into separate statements while respecting nested parentheses and quotes.
  • SQL Analysis and Linting - Integrates formatting into commit hooks to ensure SQL code consistency through automated linting.
  • Formatting Automations - Provides integration for automatically cleaning and formatting SQL files via version control hooks.
  • Indentation Depth Tracking - Tracks nesting depth of SQL clauses to apply consistent leading whitespace and alignment.
  • Keyword Normalizations - Implements mapping of SQL keywords to a consistent casing format via a predefined dictionary.
  • Regular Expression-Based Parsing - Uses compiled regular expression patterns to categorize SQL keywords and operators during lexing.
  • String Tokenization - Provides a mechanism to break SQL strings into discrete tokens based on patterns for further analysis.
  • Token Grouping - Clusters tokens into nested groups to create a hierarchical representation of SQL queries.
  • SQL Parsers - Non-validating SQL parser for Python.
  • Text Processing - Provides a non-validating parser for SQL statements.

Star 历史

andialbrecht/sqlparse 的 Star 历史图表andialbrecht/sqlparse 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

常见问题解答

andialbrecht/sqlparse 是做什么的?

sqlparse 是一个用于 SQL 语句程序化分析和操作的 Python 库。它提供了一个非验证解析器,将 SQL 文本分解为标记,并提供了一个将包含多个查询的字符串划分为单个语句的实用程序。

andialbrecht/sqlparse 的主要功能有哪些?

andialbrecht/sqlparse 的主要功能包括:SQL Parsers, SQL Formatting, SQL Formatters, Script Splitting, SQL Statement Parsing, String Splitting, SQL Analysis and Linting, Formatting Automations。

andialbrecht/sqlparse 有哪些开源替代品?

andialbrecht/sqlparse 的开源替代品包括: 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…

Sqlparse 的开源替代方案

相似的开源项目,按与 Sqlparse 的功能重合度排序。
  • jdorn/sql-formatterjdorn 的头像

    jdorn/sql-formatter

    3,857在 GitHub 上查看↗

    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

    HTML
    在 GitHub 上查看↗3,857
  • tobymao/sqlglottobymao 的头像

    tobymao/sqlglot

    9,336在 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
    在 GitHub 上查看↗9,336
  • jooq/jooqjOOQ 的头像

    jOOQ/jOOQ

    6,666在 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
    在 GitHub 上查看↗6,666
  • sqlfluff/sqlfluffsqlfluff 的头像

    sqlfluff/sqlfluff

    9,525在 GitHub 上查看↗

    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

    Pythonhacktoberfestpypisql
    在 GitHub 上查看↗9,525
  • 查看 Sqlparse 的所有 30 个替代方案→