Pglast

Latest version: v7.2

Safety actively analyzes 693308 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 13 of 21

3.0.dev0

~~~~~~~~~~~~~~~~~~~~~

- Expose the new ``pg_query_scan()`` function as ``parser.scan()``

- Expose the ``pg_query_parse()`` function as ``parser.parse_sql_json()``

- Expose the new ``pg_query_parse_protobuf()`` function as ``parser.parse_sql_protobuf()``

- Expose the new ``pg_query_deparse_protobuf()`` function as ``parser.deparse_protobuf()``

- Honor the ``catalogname`` of a ``RangeVar`` if present (`issue 71`__)

__ https://github.com/lelit/pglast/issues/71

- Cover almost all ``SQL`` statements, testing against the whole ``PostgreSQL`` `regression
suite`__ (`issue 68`__, `PR 72`__ and `PR 77`__), thanks to Ronan Dunklau and Hong Cheng

__ https://github.com/pganalyze/libpg_query/tree/13-latest/test/sql/postgres_regress_
__ https://github.com/lelit/pglast/issues/68
__ https://github.com/lelit/pglast/pull/72
__ https://github.com/lelit/pglast/pull/77

- New rudimentary support for the `preserve comments` feature (`issue 23`__)

__ https://github.com/lelit/pglast/issues/23

~~~~~~~~~~~~~~~~~~~~
**Breaking changes**
~~~~~~~~~~~~~~~~~~~~

- Target PostgreSQL 13

- The ``pglast.parser`` module exposes all ``libpg_query`` entry points, even the new
``pg_query_deparse_protobuf()`` function that is basically equivalent to
``RawStream``\ -based printer

- The ``split()`` function is now based on the lower level ``pg_query_split_with_xxx()``
functions

- The ``parse_sql()`` function returns native Python objects, not a ``JSON`` string as before:
all PG *nodes* are now represented by subclasses of ``pglast.ast.Node``, without exception,
even ``Expr`` and ``Value`` are there. The latter impacts on ``pglast.node.Scalar``: for
example it now may contains a ``ast.Integer`` instance instead of a Python ``int``

- The ``pgpp --parse-tree`` output is a `pprint`__ represention of the ``AST``, not a ``JSON``
string as before

__ https://docs.python.org/3.9/library/pprint.html#pprint.pprint

- The ``ParseError`` exception does not expose the ``location`` as an instance member anymore,
although its still there, as the second argument (ie ``.args[1]``); furthermore, its value
now corresponds to the index in the original Unicode string, instead of the offset in the
``UTF-8`` representation passed to the underlying C function


Version 2

2.0.dev3

~~~~~~~~~~~~~~~~~~~~~

- Handle ``INCLUDE`` clause in ``IndexStmt`` (`PR 67`__), thanks to Ronan Dunklau

__ https://github.com/lelit/pglast/pull/67

2.0.dev2

~~~~~~~~~~~~~~~~~~~~~

- Merge new ``fingerprint`` functionality from ``v1`` (i.e. ``master``) branch

2.0.dev1

~~~~~~~~~~~~~~~~~~~~~

- Require Python 3.6 or greater

- Handle ``ALTER TYPE .. RENAME VALUE`` in ``AlterEnumStmt`` (`PR 52`__), thanks to Ronan
Dunklau

__ https://github.com/lelit/pglast/pull/52

- Add support for Create / Alter / Drop PROCEDURE (`PR 48`__), thanks to Ronan Dunklau

__ https://github.com/lelit/pglast/pull/48

- Use Ronan's fork__ of libpg_query, targeting PostgreSQL 12.1 (`PR 36`__)

__ https://github.com/rdunklau/libpg_query
__ https://github.com/lelit/pglast/pull/36

- Change get_postgresql_version() to return a ``(major, minor)`` tuple (`issue 38`__)

__ https://github.com/lelit/pglast/issues/38

- Handle ``ALTER TABLE ... ALTER COLUMN ... SET STORAGE ...``

- Handle PG12 materialized CTEs (`issue 57`)

- Support column numbers in ``ALTER INDEX`` (`PR 58`__), thanks to Ronan Dunklau

__ https://github.com/lelit/pglast/pull/58

- Handle ``SET LOGGED`` and ``SET UNLOGGED`` in ``ALTER TABLE`` (`PR 59`__), thanks to Ronan
Dunklau

__ https://github.com/lelit/pglast/pull/59

- Handle ``ALTER TYPE ... RENAME`` (`PR 62`__), , thanks to Ronan
Dunklau

__ https://github.com/lelit/pglast/pull/62


Version 1

1.18

~~~~~~~~~~~~~~~~~

- Fix exclusion constraint printer (`issue 81`__)

__ https://github.com/lelit/pglast/issues/81

1.17

~~~~~~~~~~~~~~~~~

- Fix the generic case in the ``RenameStmt`` printer

Page 13 of 21

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.