This release upgrades libpg_query
so contains breaking changes.
New:
- Introduced a
parse_debug
function to allow for consuming functions to inspect the raw JSON output fromlibpg_query
. This is likely only used internally by library authors, but a useful feature nonetheless.
Modified:
- Updated
libpg_query
to 15-4.2.2. This required a lot of refactoring to support the modified AST being generated. - String generation is now feature gated under
str
. This feature is not feature complete so should be used with caution. Please note, this is currently enabled by default.
Other:
- Bumped the project version to
2021
and updated syntax accordingly.
Please note that some syntax support has been dropped between Postgres version releases. For example,
the ?
placeholder is no longer supported. For a full list, please see the libpg_query
changelog.
Modified:
Thank you @haileys for your contribution!
Modified:
- Updated
regex
library to remove potential security vulnerability.
Modified:
- Updated to latest
libpg_query
version which fixes some memory leaks. - Removed
clippy
build dependency which was subject to a potential security vulnerability.
New:
to_string
functionality for AST allowing you to turn the parsed tree back into SQL.
Renamed project from pg_query.rs
to pg_parse
. Going forward the pganalyze
team will maintain the official fork
leveraging protobuf whereas this library will continue to use the JSON subsystem.
- Remove
Expr
from generated output since it is a generic superclass.
Fixes issue when parsing some statements that would contain trailing null objects in an array. Deserialization of these
is now performed correctly. Note that this may cause some differing behavior from other libpg_query
implementations
whereby a "null object" is intended to indicate the end of an array.
An example of this behaviour is SELECT DISTINCT a, b FROM c
. The distinct_clause
generates [{}]
from libpg_query
.
pg_query.rs
now parses this as vec![]
.
- Enums can now be compared directly.
Null
is generated with empty parameters to support JSON mapping.
Updates libpg_query
dependency to 13-2.1.0
.
- Fixes
Value
parsing in some situations such as fortypemod
- Adds in the
List
node type by generatingnodes/pg_list
instructdef
. - Implement
std::error::Error
forError
type