[TMP] IBX-12043: Upgraded to Doctrine DBAL 4 - #39
Open
ViniTou wants to merge 2 commits into
Open
Conversation
ViniTou
force-pushed
the
dbal-4-upgrade
branch
3 times, most recently
from
August 7, 2026 10:17
d919a11 to
1f91bb5
Compare
ViniTou
force-pushed
the
dbal-4-upgrade
branch
2 times, most recently
from
August 21, 2026 10:32
eaf558e to
efa4dc7
Compare
Binding types became enums, so Connection::ARRAY_PARAM_OFFSET arithmetic is replaced by a mapping onto ArrayParameterType and getBindingTypeForColumn() returns ParameterType. QueryBuilder::getQueryPart() is gone, so already-joined tables are tracked per QueryBuilder via core's JoinedTablesTracker and an uninitialised sub-select is recognised from the builder itself. 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 now matches the postgres service image. DBAL 4 makes lastInsertId() throw NoIdentityValue instead of returning "0" when the statement generated none, which breaks doInsert() for tables that have no auto-increment column, such as the child table of a joined inheritance hierarchy where the caller supplies the identifier. Those call sites now use doInsertWithoutIdentity() and never ask for a value the database was never going to produce.
Points ibexa/core, ibexa/doctrine-schema, ibexa/test-core at their dbal-4-upgrade branches so this one can resolve before they are merged. Revert this commit once they are.
ViniTou
force-pushed
the
dbal-4-upgrade
branch
from
August 21, 2026 11:51
efa4dc7 to
3955f39
Compare
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:
Important
composer.jsoncarries[TMP]pointers foribexa/core,ibexa/doctrine-schemaandibexa/test-core(dev-dbal-4-upgrade as 6.0.x-dev). All must be reverted to~6.0.x-devonce those PRs merge, before this PR is mergeable.Description:
Binding types became enums, and
QueryBuilder::getQueryPart()was removed. Both ripple into public signatures.Parameter types:
Connection::ARRAY_PARAM_OFFSETis gone, so theParameterType+ offset arithmetic that turned a scalar binding type into an array one is replaced by an explicit mapping —DoctrineSchemaMetadata::getArrayBindingTypeForColumn(), next to the existing lookupgetBindingTypeForColumn()returnsParameterTypeinstead ofint— signature change onDoctrineSchemaMetadataInterfaceParameterwidens its type to matchgetQueryPart()removal — both answers now come from the query builder itself, since in both cases the builder may have been set up by the calling gateway rather than by this code:NonUniqueAlias. A gateway is free to join a relationship's table before handing the query over —ibexa/shippingdoes exactly that foribexa_shipping_method_region, which theShippingMethodRegioncriterion then joins again — so tracking only what this strategy joined gives the wrong answer and the query becomes unbuildable.getSQL(), which throwsQueryExceptionwhen no SELECT expressions have been provided.Insert identifiers — the change worth the most review:
lastInsertId()returned"0"for a table that generates no identity and callers discarded it. DBAL 4's MySQL driver throwsNoIdentityValue; PostgreSQL instead falls back toLASTVAL()and returns whichever sequence the session last touched, so the value was wrong there too — silently.doInsert()now returns the identifier the caller supplied in$datawhen the table has a single identifier column and that column is present, and only readslastInsertId()otherwise. Callers need no change, and a table whose id comes from its parent stops being a landmine.doInsertWithoutIdentity()remains for tables with no single identifier to return — composite-keyed assignment tables. Four call sites org-wide, all inibexa/order-management.DoctrineSchemaMetadataInterface::getIdentifierColumns()added;getIdentifierColumn()throws on composite keys, so it could not answer this.This shape was chosen over two sibling methods because whether a table generates an identity is a fixed property of the table, not of the call, and making each author pick was demonstrably error-prone: eleven sites were found and fixed by hand across four packages and a twelfth —
ibexa/share,ibexa_collaboration_content— was still missed. It needs no change under this behaviour.For QA:
INcomparisons, which are the array-binding pathDocumentation:
N/A