packagist martin-georgiev/postgresql-for-doctrine v3.0.0

latest releases: v3.7.0, v3.6.2, v3.6.1...
8 months ago

3.0.0 (2025-03-30)

⚠️🚨 BREAKING CHANGES

For detailed upgrade guide read here: UPGRADE.md

1. Type Preservation for PostgreSQL numerical and text arrays

The library now attempts to strictly preserve the type of values when converting between PostgreSQL arrays and PHP arrays. This affects all array type handlers including TextArray, integer arrays, and boolean arrays.

What changed: Previously, numeric values could lose their type information during conversion (e.g., floats might become integers, string representations of numbers might become actual numbers). With version 3.0.0, the original data types are preserved in both directions. The change comes from PR #304.

Examples:

  • Integer values like 1 remain integers
  • Float values like 1.5 remain floats
  • String representations like '1' remain strings
  • Boolean values like true/false remain booleans
  • Scientific notation like '1.23e5' is preserved

2. Refactored Exception Handling for JsonbArray

The exception handling for JsonbArray has been refactored to be more consistent with the network types approach, providing clearer error messages and better diagnostics.

What changed: Previously, generic exceptions were thrown when JSON array conversion failed. With version 3.0.0, specific InvalidJsonbArrayItemForPHPException is used with more descriptive error messages about the exact nature of the failure. The change comes from PR #311.

Features

Added new data types

  • Add support for array of float types real[] and double precision[] (#307) (1db35ac)
  • Add support for network types inet, inet[], cidr, cidr[], macaddr, macaddr[] (#310) (ba3f9f2)

Added new functions

Extended support in some existing functions

  • Add support for NULL value in array_append(), array_replace(), array_prepend(), array_remove() (#322) (396856f)
  • Add support for DISTINCT and ORDER BY clauses to json_agg() and jsonb_agg() (#317) (4cdc638)
  • Add support for DISTINCT clause to array_agg() (#316) (3c46021)

Code Refactoring

  • Modernise the validation in active code and the associated tests when dealing with integer arrays (#308) (67c344e)

Don't miss a new postgresql-for-doctrine release

NewReleases is sending notifications on new releases.