[TMP] IBX-12043: Upgraded to Doctrine DBAL 4 - #800
Open
ViniTou wants to merge 2 commits into
Open
Conversation
ViniTou
force-pushed
the
dbal-4-upgrade
branch
4 times, most recently
from
August 7, 2026 06:42
3db25cb to
a9211a9
Compare
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. The PostgreSQL CI job passed the server version as "server_version", which DoctrineBundle never reads; it hands DBAL 4 an empty string instead and the PostgreSQL driver rejects it. The query parameter is "serverVersion", and its value is derived from the matrix image. MariaDB platforms no longer extend MySQLPlatform in DBAL 4, so the random sort clause handler stopped recognising them and every MariaDB installation lost its Random sort clause. It now matches AbstractMySQLPlatform, the common ancestor of both vendors.
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Related PRs:
dbal-4-upgradeImportant
composer.jsoncarries 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-devonce 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/coreandibexa/doctrine-schemaare the two packages pinningdoctrine/dbalto 3.x, so both have to move for anything downstream to follow. The constraint goes straight to^4.4.4rather than widening.Most of the diff is the mechanical consequence of four DBAL 4 changes:
ParameterType/ArrayParameterTypebecame enums (so the remaining legacyPDO::PARAM_*constants are gone, andarray_unique()over them needsSORT_REGULAR),ExpressionBuilderand join conditions are string-only,QueryBuilder::select()/addSelect()became variadic, andQueryBuilder::execute(),Statement::execute(),Result::fetch(),getQueryPart()andupdate()'s alias parameter were removed.The part worth a reviewer's attention is platform handling. DBAL 4 removed the
platformconnection parameter, and DoctrineBundle deprecated itsplatform_serviceequivalent in 2.9 for the same reason. This is silent: the connection still accepts and echoes the parameter but returns the stock platform, soSqliteDbPlatform's schema-generation behaviour — notably keeping composite primary keys on tables SQLite cannot express withAUTOINCREMENT— 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 existingDbPlatformFactory, which keeps the choice visible at the point of use.CoreInstallertherefore takesDbPlatformFactoryInterfaceas a required constructor argument, andDatabasePlatformResolver/DatabasePlatformNamemove down toibexa/doctrine-schema, which owns the DBAL abstraction and whichibexa/coredepends on.Two latent bugs surfaced on the way:
updateAlwaysAvailableFlag()comparedexecuteQuery()'sResultagainst0(always false — it neededexecuteStatement()), and thedata_float*columns bound with anullparameter type that DBAL 4 rejects outright.MariaDB regressed silently on top of that. DBAL 4 reparents
MariaDBPlatformfromMySQLPlatformtoAbstractMySQLPlatform, soMySqlRandom::supportsPlatform()stopped recognising it andRandomSortClauseHandlerFactorythrewNo RandomSortClauseHandler found for driver Doctrine\DBAL\Platforms\MariaDB1010Platformas soon as the legacy search handler was initialised — every MariaDB installation, not just the Random sort clause. It now matchesAbstractMySQLPlatform, the ancestor both vendors share, and a new test pins the platform-to-handler mapping across MySQL 8.0/8.4 and MariaDB 10.10/11. No repository in the organisation runs MariaDB in CI, so this only surfaced by running a downstream integration suite against MariaDB 11 by hand.Note that DBAL 4.4 deprecates declaring an auto-increment column inside a composite primary key, which
ibexa_content_type,ibexa_content_type_field_definitionandibexa_content_fieldall 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. MariaDB deserves particular attention: nothing in CI covers it, and content search with a Random sort clause is the specific path that was broken.
Documentation:
N/A