Releases: sad-spirit/pg-wrapper
Beta of new major 3.0 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
andPreparedStatement
classes, it is possible to log queries to PSR-3 logger using these
Release 2.5.0 - minor fixes and major deprecations
- 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 passedfloat
-typed value.$block
property oftypes\Tid
class no longer has anint
typehint: block number is an unsigned 32-bit integer and may be out of range of PHP's signedint
type on 32-bit builds.
Release 2.4.1 - Array parsing fixes
- 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
andoidvector
types used in system catalogs
Release 2.4.0 - PreparedStatement major update, multiple renames
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()
andexecuteParams(array $params)
. The former will use the values bound withbindValue()
/bindParam()
, the latter only those passed in$params
. Passing$params
toexecute()
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 ofbind*()
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
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
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
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
- Classes representing complex Postgres types now implement
JsonSerializable
interface and can be correctly JSON-encoded. Decoding is possible viacreateFromArray()
static method defined in package'sArrayRepresentable
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
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()
andConnectionAware::setConnectionResource()
, nowsetConnection()
) of PHP's pgsql extension now acceptsad_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
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