[TMP] IBX-12043: Upgraded to Doctrine DBAL 4 - #800
Open
ViniTou wants to merge 2 commits into
Open
Conversation
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.
|
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.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.
Documentation:
N/A