Skip to content

[TMP] IBX-12043: Upgraded to Doctrine DBAL 4 - #800

Open
ViniTou wants to merge 2 commits into
6.0from
dbal-4-upgrade
Open

[TMP] IBX-12043: Upgraded to Doctrine DBAL 4#800
ViniTou wants to merge 2 commits into
6.0from
dbal-4-upgrade

Conversation

@ViniTou

@ViniTou ViniTou commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12043

Related PRs:

Important

composer.json carries a [TMP] pointer "ibexa/doctrine-schema": "dev-dbal-4-upgrade as 6.0.x-dev" so this branch can resolve the unreleased schema package. It must be reverted to ~6.0.x-dev once doctrine-schema#45 merges, before this PR is mergeable.

Description:

Stage 3 of the staged Doctrine upgrade (stages 1 and 2 — DBAL 3 cleanup and ORM 3 — already shipped under IBX-12043). ibexa/core and ibexa/doctrine-schema are the two packages pinning doctrine/dbal to 3.x, so both have to move for anything downstream to follow. The constraint goes straight to ^4.4.4 rather than widening.

Most of the diff is the mechanical consequence of four DBAL 4 changes: ParameterType/ArrayParameterType became enums (so the remaining legacy PDO::PARAM_* constants are gone, and array_unique() over them needs SORT_REGULAR), ExpressionBuilder and join conditions are string-only, QueryBuilder::select()/addSelect() became variadic, and QueryBuilder::execute(), Statement::execute(), Result::fetch(), getQueryPart() and update()'s alias parameter were removed.

The part worth a reviewer's attention is platform handling. DBAL 4 removed the platform connection parameter, and DoctrineBundle deprecated its platform_service equivalent in 2.9 for the same reason. This is silent: the connection still accepts and echoes the parameter but returns the stock platform, so SqliteDbPlatform's schema-generation behaviour — notably keeping composite primary keys on tables SQLite cannot express with AUTOINCREMENT — was being dropped without any error. Rather than reinstating the removed behaviour behind a driver middleware, DDL-generating call sites now resolve the Ibexa platform explicitly through the existing DbPlatformFactory, which keeps the choice visible at the point of use. CoreInstaller therefore takes DbPlatformFactoryInterface as a required constructor argument, and DatabasePlatformResolver/DatabasePlatformName move down to ibexa/doctrine-schema, which owns the DBAL abstraction and which ibexa/core depends on.

Two latent bugs surfaced on the way: updateAlwaysAvailableFlag() compared executeQuery()'s Result against 0 (always false — it needed executeStatement()), and the data_float* columns bound with a null parameter type that DBAL 4 rejects outright.

Note that DBAL 4.4 deprecates declaring an auto-increment column inside a composite primary key, which ibexa_content_type, ibexa_content_type_field_definition and ibexa_content_field all do. That is a schema design question well beyond this upgrade and is left as-is.

For QA:

Schema installation and the legacy storage/search gateways are the surfaces touched. Worth verifying a fresh install and a reinstall over an existing schema on MySQL, MariaDB and PostgreSQL, since SQLite is the only backend exercised by the automated suites here.

Documentation:

N/A

ViniTou added 2 commits August 7, 2026 07:57
DBAL 4 turns ParameterType and ArrayParameterType into enums, makes ExpressionBuilder and join conditions string-only, drops the "platform" connection parameter, and removes QueryBuilder::execute(), Statement::execute(), Result::fetch() and getQueryPart(). Because a custom platform can no longer ride on the connection, DDL-generating call sites resolve Ibexa's platform explicitly through DbPlatformFactory. Four long-suppressed baseline entries also became runtime TypeErrors once DBAL added native parameter types.
Points ibexa/doctrine-schema at their dbal-4-upgrade branches so this one can resolve before they are merged. Revert this commit once they are.
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant