- Produce wheels for macOS arm64
Re-enable Linux 32bit wheels, thanks to libpg_query to 16-5.1.0
__ https://github.com/pganalyze/libpg_query/releases/tag/16-5.1.0
No visible changes with respect to v5, apart from the support for new/revised syntaxes of PostgreSQL 16
- Do not build binary wheels for Python 3.8
Skip compilation on Linux 32bit (see this comment for details)
Target PostgreSQL 16, thanks to libpg_query 16-5.0.0__
__ https://github.com/pganalyze/libpg_query/releases/tag/16-5.0.0
Fix issue 143__, affecting
AlterOwnerStmt
andRenameStmt
printers__ #143
Fix issue #142__, a glitch that affected 32-bit systems
__ #142
Use Cython 3.0.7__
__ https://github.com/cython/cython/blob/master/CHANGES.rst#307-2023-12-19
Update libpg_query to 15-4.2.4__
__ https://github.com/pganalyze/libpg_query/releases/tag/15-4.2.4
Fix issue #138__, a defect that hindered the creation of AST nodes that act as markers, (currently
A_Star
andCheckPointStmt
), that do not carry any other information__ #138
Use Cython 3.0.6__
__ https://github.com/cython/cython/blob/master/CHANGES.rst#306-2023-11-26
- Handle the
ENABLE TRIGGER ALL
inAlterTableCmd
Fix issue #136__, a regression introduced by “Avoid overly abundancy of parentheses in expressions”
__ #136
Use Cython 3.0.3__
__ https://github.com/cython/cython/blob/master/CHANGES.rst#303-2023-10-05
Produce wheels using final Python 3.12 release, thanks to
cibuildwheel
2.16.2____ https://cibuildwheel.readthedocs.io/en/stable/changelog/#v2162
Improve documentation, adding
parser.Displacements
,parser.scan
andparser.split
examples (issue #128__)__ #128
Fix issues #129__ and #130__ (merged from version 4.4__)
__ #129 __ #130 __ 4.4 (2023-08-24)
Update libpg_query to 15-4.2.3__
__ https://github.com/pganalyze/libpg_query/releases/tag/15-4.2.3
Update libpg_query to 15-4.2.1__
__ https://github.com/pganalyze/libpg_query/releases/tag/15-4.2.1
Merge version 4.2__ changes
- No changes
Update libpg_query to 15-4.2.0__
__ https://github.com/pganalyze/libpg_query/releases/tag/15-4.2.0
Change the type of the
ast.Float
value fromDecimal
tostr
Using a
Decimal
implies potential differences in the representation of floating numbers, and already caused issues (#91__ and #100__) in the past, making it impossible to render, say,SELECT 0.0e1
, due to the fact thatDecimal('0.0e1')
resolves toDecimal('0')
.
No visible changes with respect to v4, apart from the support for new/revised syntaxes of PostgreSQL 15__
Target PostgreSQL 15, thanks to libpg_query 15-4.0.0__
__ https://github.com/pganalyze/libpg_query/releases/tag/15-4.0.0
Use Cython 3.0.2__
__ https://github.com/cython/cython/blob/master/CHANGES.rst#302-2023-08-27
Fix issues #129__ and #130__ (merged from version 3.18__)
__ #129 __ #130 __ 3.18 (2023-08-24)
Fix serialization issue__ when column's
DEFAULT
value is an expression
- Handle special syntax required by
SET TIME ZONE INTERVAL '-08:00' hour to minute
- Fix mistype mapping of raw C "long" and "double" attributes, that were decorated with the wrong Python type
Fix serialization glitches introduced by “Avoid overly abundancy of parentheses in expressions” (to be precise, by this__ commit)
__ https://github.com/lelit/pglast/commit/6cfe75eea80f9c9bec4ba467e7ec1ec0796020de
Update libpg_query to final 14-3.0.0__
__ https://github.com/pganalyze/libpg_query/releases/tag/14-3.0.0
Update libpg_query to 14-3.0.0__
__ https://github.com/pganalyze/libpg_query/blob/14-latest/CHANGELOG.md#14-300---2022-11-17
- Avoid overly abundancy of parentheses in expressions
- Prefer
SELECT a FROM b LIMIT ALL
to... LIMIT NONE
- Target PostgreSQL 14
The wrapper classes used in previous versions, implemented in
pglast.node
, are gone: now everything works on top of theAST
classes (issue #80__)__ #80
- The
Ancestor
class is not iterable anymore: it was an internal implementation facility, now moved to a_iter_members()
method
Fix
BooleanTest
printer, enclosing expression within parens in more cases (issue #129__)__ #129
Fix
Constraint
printer, avoiding repetition of "DEFERRABLE INITIALLY DEFERRED" on some kind of constraints (issue #130__)__ #130
- Fix
AlterSubscriptionStmt
printer, handling "SET PUBLICATION" without options
Update libpg_query to 13-2.2.0__
__ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-220---2022-11-02
Produce Python 3.11 wheels (PR #108__), thanks to
cibuildwheel
2.11.1__ and to Bastien Gandouet__ #108 __ https://cibuildwheel.readthedocs.io/en/stable/changelog/#v2111
Harden the way
Visitor
handle modifications to the AST (issue #107__)__ #107
Update libpg_query to 13-2.1.2__
__ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-212---2022-06-28
Rewrite the implementation of the
referenced_relations()
function, that was flawed with regard to CTEs handling (issue #106__), thanks to Michal Charemza for providing his own version__ #106
- Improve
WithClause
printer indentation - Fix minor whitespace related issues in a few printer functions
- Fix the
Visitor
class, it was ignoring nodes nested in sub-lists - Reduce the size of the generated parser by factoring out common code into helper functions
Update libpg_query to 13-2.1.1__ (PR #102__), thanks to James Guthrie
__ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-211---2022-05-03 __ #102
Produce musllinux__ wheels, thanks to
cibuildwheel
2.5.0__ (PEP 656 was actually introduced in 2.2.0__)__ https://peps.python.org/pep-0656/ __ https://cibuildwheel.readthedocs.io/en/stable/changelog/#v250 __ https://cibuildwheel.readthedocs.io/en/stable/changelog/#v220
Fix bug handling node containing a
location
field, e.g.CreateTableSpaceStmt
(issue #98__)__ #98
Properly handle dereferenced array expression (issue #99__)
__ #99
Avoid improper "floatification" of literal integers (issue #100__)
__ #100
Fix glitch in the AST extractor tool (issue #97__)
__ #97
Add Linux AArch64 wheel build support (PR #95__), thanks to odidev
__ #95
Fix type mismatch when using
--remove-pg_catalog-from-functions
(PR #93__), thanks to Boris Zentner__ #93
Update libpg_query to 13-2.1.0__
__ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-210---2021-10-12_
Use latest libpg_query, to fix an error parsing
PLpgSQL
statements (issue #88__)__ #88
Forward the
special_functions
option to substream, when concatenating items (issue #89__)__ #89
Fix representation of floating point numbers without decimal digits (issue #91__)
__ #91
- Produce Python 3.10 wheels, thanks to
cibuildwheel
2.1.2 Update libpg_query to 13-2.0.7__
__ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-207---2021-07-16_
New option
--remove-pg_catalog-from-functions
on the command line tool (PR #90__), thanks to Boris Zentner__ #90
Implement more special functions (PR #92__), thanks to Boris Zentner
__ #92
Fix another packaging issue, that prevented recompilation from the sdist
.tar.gz
(issue #86__), thanks to Christopher Brichford__ #82
Update libpg_query to 13-2.0.6__
__ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-206---2021-06-29_
Effectively include libpg_query's vendored sources (issue #82__)
__ #82
Fix packaging glitch (issue #82__)
__ #82
- Build wheels also for macOS
Update libpg_query to 13-2.0.5__
__ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-205---2021-06-24_
- Fix glitch in the
RawStream
, avoiding spurious space after an open parenthesis - Improve the
Visitor
class, to make it easier altering the original tree - Properly handle nested lists in the serialization of AST Node
Fix bug in
CreateStmt
printer (issue #79__)__ #79
- Make it possible to pass also concrete
ast.Node
s toRawStream
`
- To reduce confusion, the
printer
module has been removed: print-specific stuff is now directly exposed by theprinters
subpackage while serialization classes are now in the newstream
module - The default value for the
safety_belt
option of theprintify()
function is nowFalse
- Fix
AT_SetIdentity
,AT_EnableReplicaTrig
andAlterSubscriptionStmt
printers - Improve
AlterTSConfigType
andIntoClause
printers New generic "visitor pattern" (issue #51__) exemplified by a new
referenced_relations()
function (issue #66__)- Refine printing of SQL comments
- Implement
AlterExtensionStmt
printer
- Expose the new
pg_query_scan()
function asparser.scan()
- Expose the
pg_query_parse()
function asparser.parse_sql_json()
- Expose the new
pg_query_parse_protobuf()
function asparser.parse_sql_protobuf()
- Expose the new
pg_query_deparse_protobuf()
function asparser.deparse_protobuf()
Honor the
catalogname
of aRangeVar
if present (issue #71__)__ #71
Cover almost all
SQL
statements, testing against the wholePostgreSQL
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_ __ #68 __ #72 __ #77
New rudimentary support for the preserve comments feature (issue #23__)
__ #23
- Target PostgreSQL 13
- The
pglast.parser
module exposes alllibpg_query
entry points, even the newpg_query_deparse_protobuf()
function that is basically equivalent toRawStream
-based printer - The
split()
function is now based on the lower levelpg_query_split_with_xxx()
functions - The
parse_sql()
function returns native Python objects, not aJSON
string as before: all PG nodes are now represented by subclasses ofpglast.ast.Node
, without exception, evenExpr
andValue
are there. The latter impacts onpglast.node.Scalar
: for example it now may contains aast.Integer
instance instead of a Pythonint
The
pgpp --parse-tree
output is a pprint__ represention of theAST
, not aJSON
string as before__ https://docs.python.org/3.9/library/pprint.html#pprint.pprint
- The
ParseError
exception does not expose thelocation
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 theUTF-8
representation passed to the underlying C function
Handle
INCLUDE
clause inIndexStmt
(PR #67__), thanks to Ronan Dunklau__ #67
- Merge new
fingerprint
functionality fromv1
(i.e.master
) branch
- Require Python 3.6 or greater
Handle
ALTER TYPE .. RENAME VALUE
inAlterEnumStmt
(PR #52__), thanks to Ronan Dunklau__ #52
Add support for Create / Alter / Drop PROCEDURE (PR #48__), thanks to Ronan Dunklau
__ #48
Use Ronan's fork__ of libpg_query, targeting PostgreSQL 12.1 (PR #36__)
Change get_postgresql_version() to return a
(major, minor)
tuple (issue #38__)__ #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__ #58
Handle
SET LOGGED
andSET UNLOGGED
inALTER TABLE
(PR #59__), thanks to Ronan Dunklau__ #59
Handle
ALTER TYPE ... RENAME
(PR #62__), , thanks to Ronan Dunklau__ #62
Fix exclusion constraint printer (issue #81__)
__ #81
- Fix the generic case in the
RenameStmt
printer
- Promote to the stable state
- Move the job of building and uploading binary wheels from TravisCI to GitHub Actions
Fix
IF EXISTS
variant ofRenameStmt
printer (PR #70__), thanks to Jonathan Mortensen__ #70
- Update libpg_query to 10-1.0.5
- Produce Python 3.9 wheels, thanks to
cibuildwheel
1.6.3 Expose the
libpg_query
's fingerprint__ functionality (PR #64__), thanks to Yiming Wang__ https://github.com/lfittl/libpg_query/wiki/Fingerprinting __ #64
- Handle
SELECT FROM foo
Double quote column names in the
TYPE_FUNC_NAME_KEYWORDS
set (issue #55__)__ #55
Possibly wrap
SELECT
inUNION
/INTERSECT
between parens, when needed (issue #55__)__ #55
Fix
A_Expr
printer, whenlexpr
is missing (PR #54__), thanks to Aiham__ #54
Support
DISABLE ROW LEVEL SECURITY
inAlterTableCmd
(PR #49__), thanks to Ronan Dunklau__ #49
Implement
CreateOpClassStmt
printer (PR #47__), thanks to Ronan Dunklau__ #47
Fix collation name printer (PR #44__), thanks to Ronan Dunklau
__ #44
Implement
CreatePLangStmt
printer (PR #42__), thanks to Bennie Swart__ #42
Fix privileges printer (PR #41__), thanks to Bennie Swart
__ #41
Handle
TRUNCATE
event inCreateTrigStmt
printer (PR #40__), thanks to Bennie Swart__ #40
Fix function body dollar quoting (PR #39__), thanks to Bennie Swart
__ #39
- Prettier
INSERT
representation
- Prettier
CASE
representation New option to emit a semicolon after the last statement (issue #24__)
__ #24
- Implement
NotifyStmt
printer Implement
RuleStmt
printer, thanks to Gavin M. Roy for his PR #28____ #28
- Fix
RenameStmt
, properly handling object name Produce Python 3.8 wheels, thanks to cibuildwheel__ 1.0.0
Support
ALTER TABLE RENAME CONSTRAINT
(PR #35__), thanks to Ronan Dunklau__ #35
Fix issue with boolean expressions precedence (issue #29__)
__ #29
- Implement
BitString
printer Support
LEAKPROOF
option (PR #31__), thanks to Ronan Dunklau__ #31
Support
DEFERRABLE INITIALLY DEFERRED
option (PR #32__), thanks to Ronan Dunklau__ #32
Fix issue with
RETURNS SETOF
functions, a more general solution than the one proposed by Ronan Dunklau (PR #22__)__ #22
Allow more than one empty line between statements (PR #26__), thanks to apnewberry
__ #26
Fix wrap of trigger's WHEN expression (issue #18__)
__ #18
Support for variadic functions (PR #19__), thanks to Ronan Dunklau
__ #19
Support ORDER / LIMIT / OFFSET for set operations (PR #20__), thanks to Ronan Dunklau
__ #20
- Implement
ConstraintsSetStmt
and improveVariableSetStmt
printers
Support
CROSS JOIN
and timezone modifiers on time and timestamp datatypes (PR #15__), thanks to Ronan Dunklau__ #15
Many new printers and several enhancements (PR #14__), thanks to Ronan Dunklau
__ #14
Expose the package version as pglast.__version__ (issue #12__)
__ #12
Implement new split() function (see PR #10__)
__ #10
Implement
BooleanTest
printer (issue #11__)__ #11
- No visible changes, but now PyPI carries binary wheels for Python 3.7.
Important
The name of the package has been changed from pg_query
to pglast
, to satisfy the request made by the author of libpg_query
in issue #9__.
This affects both the main repository on GitHub, that from now on is https://github.com/lelit/pglast
, and the ReadTheDocs project that hosts the documentation, http://pglast.readthedocs.io/en/latest/
.
I'm sorry for any inconvenience this may cause.
- Update libpg_query to 10-1.0.2
- Support the '?'-style parameter placeholder variant allowed by libpg_query (details__)
- Prettier JOINs representation, aligning them with the starting relation
- Fix cosmetic issue with ANY() and ALL()
- Fix issue in the safety belt check performed by
pgpp
(issue #4__)
- Implement
Null
printer
- Implement some other DDL statements printers
- New alternative style to print comma-separated-values lists, activated by a new
--comma-at-eoln
option onpgpp
- Implement
TransactionStmt
and almost allDROP xxx
printers
- Implement
NamedArgExpr
printer - New alternative printers for a set of special functions, activated by a new
--special-functions
option onpgpp
(issue #2__)
- Handle special de-reference (
A_Indirection
) cases
- Fix serialization of column labels containing double quotes
- Fix corner issues surfaced implementing some more DDL statement printers
- Fix endless loop due to sloppy conversion of command line option
- Install the command line tool as
pgpp
- Rename printers.sql to printers.dml (backward incompatibility)
- List printer functions in the documentation, referencing the definition of related node type
- Fix inconsistent spacing in JOIN condition inside a nested expression
- Fix representation of unbound arrays
- Fix representation of
interval
data type - Initial support for DDL statements
- Fix representation of string literals containing single quotes
- Update libpg_query to 10-1.0.0
- Fix indentation of boolean expressions in SELECT's targets (issue #3__)
- Update to latest libpg_query's 10-latest branch, targeting PostgreSQL 10.0 final
- Fix representation of subselects requiring surrounding parens
- New option
--version
on the command line tool - Better enums documentation
- Release the GIL while calling libpg_query functions
- Nicer indentation for JOINs, making OUTER JOINs stand out
- Minor tweaks to lists rendering, with less spurious whitespaces
- New option
--no-location
on the command line tool
- Support Python 3.4 and Python 3.5 as well as Python 3.6
- Fix spacing before the $ character
- Handle type modifiers
- New option
--plpgsql
on the command line tool, just for fun
- Add enums subpackages to the documentation with references to their related headers
- New
compact_lists_margin
option to produce a more compact representation when possible (see issue #1__)
- Fix sdist including the Sphinx documentation
- New option
--parse-tree
on the command line tool to show just the parse tree - Sphinx documentation, available online
- Handle some more cases when a name must be double-quoted
- Complete the serialization of the WindowDef node, handling its frame options
- Expose the actual PostgreSQL version the underlying libpg_query libray is built on thru a new
get_postgresql_version()
function - New option safety_belt for the
prettify()
function, to protect the innocents - Handle serialization of
CoalesceExpr
andMinMaxExpr
- Handle serialization of
ParamRef
nodes - Expose a
prettify()
helper function
- Test coverage at 99%
- First attempt at automatic wheel upload to PyPI, let's see...
- First release ("Hi daddy!", as my soul would tag it)