# pglast

## PostgreSQL Languages AST and statements prettifier

author:

  Lele Gaifax

contact:

  lele@metapensiero.it

license:

  GNU General Public License version 3 or later

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.

Contents:

- Introduction
- Installation
- Development
  - History
- Examples of usage
  - AST level
  - Command line
- API documentation
  - `Comment`
  - `Error`
  - `__author__`
  - `__version__`
  - `parse_plpgsql()`
  - `prettify()`
  - `split()`
  - `pglast.parser` — The interface with libpg_query
  - `pglast.ast` — Python classes representing PG parser nodes
  - `pglast.enums` — Enumerated constants
  - `pglast.keywords` — Various kinds of PostgreSQL keywords
  - `pglast.stream` — The serialization machinery
  - `pglast.printers` — Specialized printer functions
  - `pglast.printers.sfuncs` — Special function printers
  - `pglast.visitors` — Other ways to inspect and manipulate the AST

## Indices and tables

- Index

- Module Index

- Search Page