{"categories":[{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/2"},{"label":"Database","url":"https://skillfed.io/packages/category/database"}],"enrichment":{"capability":"Parses PostgreSQL SQL statements into an abstract syntax tree and provides tools to inspect and prettify the parsed structure.","skillfed_tags":["sql-parsing","postgres-tools","ast-analysis"],"use_cases":["Extract table and column names from arbitrary SQL queries for dependency analysis or schema mapping","Reformat or prettify SQL statements to a consistent style for code review or documentation","Build linters or validators that check SQL queries for anti-patterns or compliance rules","Analyze query structure to optimize or rewrite statements programmatically","Generate documentation or diagrams of data lineage from SQL statement trees"],"what_it_does":"pglast is a Python module that wraps the PostgreSQL parser (via libpg_query) to expose SQL statements as an abstract syntax tree. It lets you programmatically inspect the structure of SQL queries\u2014their clauses, expressions, and relationships\u2014rather than treating them as opaque strings. The tree is built from interconnected nodes that mirror PostgreSQL's internal parse representation.\n\nThe package is typically used to analyze, validate, or transform SQL statements without executing them. Common tasks include extracting table and column references, detecting query patterns, reformatting SQL for readability, or building tools that need to understand query structure. It has no runtime dependencies and covers modern Python versions; installation requires compiled wheels for your platform.","worth_installing":"Yes, if you need to parse and inspect PostgreSQL SQL statements programmatically. The package is actively maintained, has no runtime dependencies, and covers modern Python versions. The GPL-3.0-or-later license is a blocker only if you cannot open-source derivative works; otherwise, it's a solid choice for SQL analysis tasks."},"id":"pglast","links":{"html":"https://skillfed.io/packages/pglast","md":"https://skillfed.io/packages/pglast.md","pypi":"https://pypi.org/project/pglast/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-22","license_spdx":"GPL-3.0-or-later","license_treatment":"copyleft","name":"pglast","python_support":"unspecified","summary":"PostgreSQL Languages AST and statements prettifier"},"popularity":{"monthly_downloads":4822899,"position":2220,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"8.4"}
