Skip to content
/ pglast Public

PostgreSQL Languages AST and statements prettifier: master branch covers PG10, v2 branch covers PG12, v3 covers PG13, v4 covers PG14, v5 covers PG15, v6 covers PG16, v7 covers PG17

Notifications You must be signed in to change notification settings

lelit/pglast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Mar 17, 2025
38d8b14 · Mar 17, 2025
Nov 26, 2024
Mar 17, 2025
Dec 19, 2024
Mar 17, 2025
Mar 17, 2025
Oct 27, 2024
Mar 17, 2025
Dec 28, 2021
May 8, 2021
Oct 31, 2024
Apr 10, 2024
Mar 17, 2025
Aug 14, 2021
Oct 27, 2024
Oct 31, 2024
Oct 27, 2024
Nov 1, 2024
Feb 9, 2025
Feb 9, 2025
Oct 27, 2024
Mar 17, 2025

Repository files navigation

pglast

PostgreSQL Languages AST and statements prettifier

Author: Lele Gaifax
Contact: lele@metapensiero.it
License:GNU General Public License version 3 or later
Status: Build status Documentation status Test coverage status
Version: 7

This is a Python 3 module that exposes the parse tree of a PostgreSQL statement (extracted by the almost standard PG parser repackaged as a standalone static library by libpg_query) as set of interconnected nodes, usually called an abstract syntax tree.

See a more detailed introduction in the documentation.

Installation

As usual, the easiest way is with pip:

$ pip install pglast

Alternatively you can clone the repository:

$ git clone https://github.com/lelit/pglast.git --recursive

and install from there:

$ pip install ./pglast

Development

There is a set of makefiles implementing the most common operations, a make help will show a brief table of contents. A comprehensive test suite, based on pytest, covers nearly 99% of the source lines.

Documentation

Latest documentation is hosted by Read the Docs at https://pglast.readthedocs.io/en/v7

About

PostgreSQL Languages AST and statements prettifier: master branch covers PG10, v2 branch covers PG12, v3 covers PG13, v4 covers PG14, v5 covers PG15, v6 covers PG16, v7 covers PG17

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

Languages