pg_builder 3.2 and pg_wrapper 3.3 released with support for Postgres 18

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 3.2 and pg_wrapper 3.3 released with support for Postgres 18
Date: 2025-10-12 23:18:26
Message-ID: 176031110646.763.9354932388889523869@wrigleys.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-announce

I am pleased to announce the release of [pg_builder](https://github.com/sad-spirit/pg-builder) and [pg_wrapper](https://github.com/sad-spirit/pg-wrapper) packages for PHP updated for Postgres 18.

## pg_builder 3.2

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 18 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.

Release highlights:

* Support for new syntax of PostgreSQL 18: aliases for `OLD` and `NEW` in `RETURNING` clause of DML statements.
* Node objects use `WeakReference` to keep a link to their parent node, this prevents circular references and allows garbage collection of AST fragments.

[Full release notes](https://github.com/sad-spirit/pg-builder/blob/v3.2.0/Changelog.md)

The package can be [downloaded from GitHub](https://github.com/sad-spirit/pg-builder/releases/tag/v3.2.0) or installed with Composer:

```
$ composer require sad_spirit/pg_builder
```

## pg_wrapper 3.3

pg_wrapper provides converters for PostgreSQL data types and an object-oriented wrapper for PHP's native pgsql extension that uses these converters. Conversion of query result fields is done automatically using database metadata, query parameters may require specifying type.

For those types where a corresponding native PHP type or class is available it is used (`text` -> `string`, `timestamp` -> `DateTimeImmutable`, `hstore` -> associative array, etc.). For other types (geometric types, ranges) the package provides custom classes. If a base type can be converted, then composite types, arrays, ranges using it can be automatically handled as well.

Release highlights:

* New error codes from PostgreSQL 18.

[Full release notes](https://github.com/sad-spirit/pg-wrapper/blob/v3.3.0/Changelog.md)

The package can be [downloaded from GitHub](https://github.com/sad-spirit/pg-wrapper/releases/tag/v3.3.0) or installed with Composer:

```
$ composer require sad_spirit/pg_wrapper
```

Browse pgsql-announce by date

  From Date Subject
Next Message CSPUG (Czech and Slovak PostgreSQL Users Group) via PostgreSQL Announce 2025-10-14 08:12:44 Call for Proposals / Prague PostgreSQL Developer Day 2026 / January 27-28, 2026
Previous Message PGroonga project via PostgreSQL Announce 2025-10-09 07:27:55 PGroonga 4.0.4 - Multilingual fast full text search