- Fix issue 143, affecting
AlterOwnerStmt
andRenameStmt
printers
- Fix issue #142, a glitch that affected 32-bit systems
- Use Cython 3.0.7
- Update libpg_query to 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 - Use Cython 3.0.6
- Handle the
ENABLE TRIGGER ALL
inAlterTableCmd
- Fix issue #136, a regression introduced by “Avoid overly abundancy of parentheses in expressions”
- Use Cython 3.0.3
- Produce wheels using final Python 3.12 release, thanks to
cibuildwheel
2.16.2
- Improve documentation, adding
parser.Displacements
,parser.scan
andparser.split
examples (issue #128) - Fix issues #129 and #130 (merged from version 4.4)
- Update libpg_query to 15-4.2.3
- Update libpg_query to 15-4.2.1
- Merge version 4.2 changes
- No changes
- Update libpg_query to 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
- Use Cython 3.0.2
- Fix issues #129 and #130 (merged from version 3.18)
- 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)
- Update libpg_query to final 14-3.0.0
- Update libpg_query to 14-3.0.0
- 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) - 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) - Fix
Constraint
printer, avoiding repetition of "DEFERRABLE INITIALLY DEFERRED" on some kind of constraints (issue #130)
- Fix
AlterSubscriptionStmt
printer, handling "SET PUBLICATION" without options
- Update libpg_query to 13-2.2.0
- Harden the way
Visitor
handle modifications to the AST (issue #107)
- Update libpg_query to 13-2.1.2
- 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 - 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
- Produce musllinux wheels, thanks to
cibuildwheel
2.5.0 (PEP 656 was actually introduced in 2.2.0)
- Fix bug handling node containing a
location
field, e.g.CreateTableSpaceStmt
(issue #98) - Properly handle dereferenced array expression (issue #99)
- Avoid improper "floatification" of literal integers (issue #100)
- Fix glitch in the AST extractor tool (issue #97)
- Add Linux AArch64 wheel build support (PR #95), thanks to odidev
- Fix type mismatch when using
--remove-pg_catalog-from-functions
(PR #93), thanks to Boris Zentner
- Update libpg_query to 13-2.1.0
- Use latest libpg_query, to fix an error parsing
PLpgSQL
statements (issue #88)
- Forward the
special_functions
option to substream, when concatenating items (issue #89) - Fix representation of floating point numbers without decimal digits (issue #91)
- Produce Python 3.10 wheels, thanks to
cibuildwheel
2.1.2 - Update libpg_query to 13-2.0.7
- New option
--remove-pg_catalog-from-functions
on the command line tool (PR #90), thanks to Boris Zentner - Implement more special functions (PR #92), thanks to Boris Zentner
- Fix another packaging issue, that prevented recompilation from the sdist
.tar.gz
(issue #86), thanks to Christopher Brichford
- Update libpg_query to 13-2.0.6
- Effectively include libpg_query's vendored sources (issue #82)
- 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) - 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) - 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 - New rudimentary support for the preserve comments feature (issue #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 - 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
- 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 - Add support for Create / Alter / Drop PROCEDURE (PR #48), thanks to Ronan Dunklau
- 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) - 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 - Handle
SET LOGGED
andSET UNLOGGED
inALTER TABLE
(PR #59), thanks to Ronan Dunklau - Handle
ALTER TYPE ... RENAME
(PR #62), , thanks to Ronan Dunklau
- Fix exclusion constraint printer (issue #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 - 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
- Handle
SELECT FROM foo
- Double quote column names in the
TYPE_FUNC_NAME_KEYWORDS
set (issue #55) - Possibly wrap
SELECT
inUNION
/INTERSECT
between parens, when needed (issue #55)
- Fix
A_Expr
printer, whenlexpr
is missing (PR #54), thanks to Aiham - Support
DISABLE ROW LEVEL SECURITY
inAlterTableCmd
(PR #49), thanks to Ronan Dunklau - Implement
CreateOpClassStmt
printer (PR #47), thanks to Ronan Dunklau
- Fix collation name printer (PR #44), thanks to Ronan Dunklau
- Implement
CreatePLangStmt
printer (PR #42), thanks to Bennie Swart - Fix privileges printer (PR #41), thanks to Bennie Swart
- Handle
TRUNCATE
event inCreateTrigStmt
printer (PR #40), thanks to Bennie Swart - Fix function body dollar quoting (PR #39), thanks to Bennie Swart
- Prettier
INSERT
representation
- Prettier
CASE
representation - New option to emit a semicolon after the last statement (issue #24)
- Implement
NotifyStmt
printer - Implement
RuleStmt
printer, thanks to Gavin M. Roy for his PR #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
- Fix issue with boolean expressions precedence (issue #29)
- Implement
BitString
printer - Support
LEAKPROOF
option (PR #31), thanks to Ronan Dunklau - Support
DEFERRABLE INITIALLY DEFERRED
option (PR #32), thanks to Ronan Dunklau
- Fix issue with
RETURNS SETOF
functions, a more general solution than the one proposed by Ronan Dunklau (PR #22) - Allow more than one empty line between statements (PR #26), thanks to apnewberry
- Fix wrap of trigger's WHEN expression (issue #18)
- Support for variadic functions (PR #19), thanks to Ronan Dunklau
- Support ORDER / LIMIT / OFFSET for set operations (PR #20), thanks to Ronan Dunklau
- Implement
ConstraintsSetStmt
and improveVariableSetStmt
printers
- Support
CROSS JOIN
and timezone modifiers on time and timestamp datatypes (PR #15), thanks to Ronan Dunklau - Many new printers and several enhancements (PR #14), thanks to Ronan Dunklau
- Expose the package version as pglast.__version__ (issue #12)
- 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)