Skip to content

Releases: sad-spirit/pg-wrapper

Beta of new major 3.0 release

21 Dec 10:53
Compare
Choose a tag to compare
Pre-release

Highlights:

  • Now requires PHP 8.2+ and Postgres 12+
  • Features deprecated in 2.x releases are removed
  • New iterator methods for Result
  • Decorators for Connection and PreparedStatement classes, it is possible to log queries to PSR-3 logger using these

Release 2.5.0 - minor fixes and major deprecations

12 Sep 10:21
Compare
Choose a tag to compare
  • Getters / issers methods of classes representing complex PostgreSQL types are deprecated. Magic properties should be used instead: those will be reimplemented as native public readonly ones in the next major release.
  • converters\datetime\IntervalConverter::output() could incorrectly format the passed float-typed value.
  • $block property of types\Tid class no longer has an int typehint: block number is an unsigned 32-bit integer and may be out of range of PHP's signed int type on 32-bit builds.

Release 2.4.1 - Array parsing fixes

19 Jun 12:06
Compare
Choose a tag to compare
  • Array literals with dimensions specified (e.g. [0:0]={1}) are now parsed properly (see issue #12)
  • Properly convert arrays having delimiters other than comma (e.g. box[])
  • Support int2vector and oidvector types used in system catalogs

Release 2.4.0 - PreparedStatement major update, multiple renames

20 May 20:03
Compare
Choose a tag to compare

PreparedStatement changes:

  • There is now a means to get the number of parameters for prepared statement and their types from the DB. These can also be set manually separately from parameter values.
  • There are now two separate methods for executing a prepared statement: execute() and executeParams(array $params). The former will use the values bound with bindValue() / bindParam(), the latter only those passed in $params. Passing $params to execute() is deprecated.
  • Not specifying types for parameters is now deprecated.
  • Fixed behaviour of execute(), where bound values were actually mapped to placeholders in the order of bind*() calls, not by parameter numbers.

Renames:

  • ResultSet class -> Result
  • Connection::checkRollbackNotNeeded() -> Connection::assertRollbackNotNeeded()
  • Connection::getResource() -> Connection::getNative(), Result::getResource() -> Result::getNative(), Result::createFromResultResource() -> Result::createFromReturnValue()

The former names are still working but deprecated and will be removed in the next major release.

Release 2.3.0 - Updated for Postgres 16

15 Sep 06:45
Compare
Choose a tag to compare

When connected to Postgres 16+, output() method of numeric type converters will accept strings wth non-decimal integer literals
and numeric literals with underscores for digit separators, allowing to use those as query parameter values.

Release 2.3.0 - first beta

30 Aug 17:00
Compare
Choose a tag to compare
Pre-release

Updated for Postgres 16.

When connected to Postgres 16+, output() method of numeric type converters will accept non-decimal integer literals
and numeric literals with underscores for digit separators, allowing to use those as query parameter values.

Release 2.2.0 - Refactoring of DefaultTypeConverterFactory

12 May 17:07
Compare
Choose a tag to compare

Code that deals with loading type data from DB / cache and mapping type names to type OIDs was extracted
from DefaultTypeConverterFactory into a new CachedTypeOIDMapper class implementing a new TypeOIDMapper interface.

This splits the previously 1,5k line long class to two classes of more manageable size and allows for easier enhancements via decorators and such.

Release 2.1.0 - JSON serialization for complex types

10 Apr 09:27
Compare
Choose a tag to compare
  • Classes representing complex Postgres types now implement JsonSerializable interface and can be correctly JSON-encoded. Decoding is possible via createFromArray() static method defined in package's ArrayRepresentable interface (request #11)
  • Tested and supported on PHP 8.2 and Postgres 15

Release 2.0.0 - updated for Postgres 14 and PHP 8.1

31 Dec 12:06
Compare
Choose a tag to compare

New features:

  • Support for new multirange types of Postgres 14: classes representing these on PHP side, converter to transform the values to and from DB string representation.
  • Support changes to pgsql extension done in PHP 8.1: objects are used instead of resources for connection and query results.

Major version is changed due to the following BC breaks:

  • Methods working with OIDs (e.g. TypeConverterFactory::getConverterForTypeOID()) no longer have int typehints: OIDs are unsigned 32-bit integers and may be out of range of PHP's signed int type on 32-bit builds.
  • Methods that formerly accepted connection resource (ServerException::fromConnection() and ConnectionAware::setConnectionResource(), now setConnection()) of PHP's pgsql extension now accept sad_spirit\pg_wrapper\Connection instance, this prevents the need of boilerplate code to support both PHP 8.1+ and earlier versions.

Release 2.0.0 - first beta

18 Nov 21:01
Compare
Choose a tag to compare
Pre-release

Updated for Postgres 14 and PHP 8.1

  • PHP's pgsql extension in 8.1 changed from using resources to using objects from \Pgsql\ namespace to represent connections and query results. The package can now handle both cases.
  • Full support for multirange types in Postgres 14