From: | Alexey Borzov via PostgreSQL Announce <announce-noreply(at)postgresql(dot)org> |
---|---|
To: | PostgreSQL Announce <pgsql-announce(at)lists(dot)postgresql(dot)org> |
Subject: | pg_builder 2.1.0 released with support for Postgres 15 syntax |
Date: | 2022-11-07 14:27:19 |
Message-ID: | 166783123981.654.1658848109551696834@wrigleys.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-announce |
I'm pleased to announce the release of [pg_builder PHP package](https://github.com/sad-spirit/pg-builder) updated for Postgres 15 syntax.
# pg_builder 2.1.0
pg_builder is a query builder for Postgres backed by a partial PHP reimplementation of PostgreSQL's own SQL parser. It supports almost all syntax available in Postgres 15 for `SELECT` (and `VALUES`), `INSERT`, `UPDATE`, `DELETE`, and `MERGE` queries.
With pg_builder it is possible to start with a manually written query, parse it into an Abstract Syntax Tree, add query parts (either as `Node` objects or as strings) to this tree or remove them, and finally convert the tree back to an SQL string.
Main changes in the new release
* Allow parsing and building `MERGE` statements.
* Reject numeric literals and positional parameters with trailing non-digits: previously `SELECT 123abc` was parsed as `SELECT 123 AS abc`, now it will throw an exception.
[Full release notes](https://github.com/sad-spirit/pg-builder/blob/v2.1.0/Changelog.md)
The package can be [downloaded from Github](https://github.com/sad-spirit/pg-builder/releases/tag/v2.1.0) or installed with Composer:
`$ composer require sad_spirit/pg_builder`
pg_builder can be used on its own, using it together with [pg_wrapper](https://github.com/sad-spirit/pg-wrapper) allows to run the built queries with transparent conversion of query parameters to Postgres types.
From | Date | Subject | |
---|---|---|---|
Next Message | Nordic PGDay via PostgreSQL Announce | 2022-11-07 14:31:36 | Nordic PGDAY 2023 Call for papers |
Previous Message | RapidLoop, Inc. via PostgreSQL Announce | 2022-11-07 14:26:51 | pgmetrics 1.14 released |