Skip to content

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

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

[TMP] IBX-12043: Upgraded to Doctrine DBAL 4#39
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 [TMP] pointers for ibexa/core, ibexa/doctrine-schema and ibexa/test-core (dev-dbal-4-upgrade as 6.0.x-dev). All must be reverted to ~6.0.x-dev once those PRs merge, before this PR is mergeable.

Description:

Part of the staged Doctrine upgrade under IBX-12043. Two DBAL 4 removals drive everything here.

First, binding types became enums. Connection::ARRAY_PARAM_OFFSET is gone, so the ParameterType + offset arithmetic that turned a scalar binding type into an array one has to be replaced by a mapping onto ArrayParameterType. That mapping lives next to the existing lookup as DoctrineSchemaMetadata::getArrayBindingTypeForColumn(), and getBindingTypeForColumn() now returns ParameterType rather than int — a signature change on DoctrineSchemaMetadataInterface, which is public API. Parameter widens its type accordingly.

Second, QueryBuilder::getQueryPart() is gone, and it was used to ask the builder two questions. "Has this table already been joined?" is now tracked per QueryBuilder via JoinedTablesTracker, reusing the helper ibexa/core already introduced for the same problem rather than adding a second mechanism. "Has this sub-select been given a SELECT?" is derived from the builder itself: getSQL() throws QueryException when no SELECT expressions have been provided. That is deliberate — the visitor passes the outer query builder when there is no sub-query, so the check has to reflect the builder's real state rather than what this strategy happens to have initialised.

The strategy tests previously asserted on getQueryPart() output; they now assert on generated SQL, which also covers the join idempotency that the tracker provides. Note DBAL 4 additionally validates join aliases, so a join whose fromAlias is not a registered FROM/JOIN alias now throws UnknownAlias.

For QA:

Filtering and sorting through the persistence layer's Doctrine gateways is the surface touched, in particular criteria that filter on a related entity (sub-select and joined relationship types) and IN comparisons, which are the array-binding path.

Documentation:

N/A

@ViniTou ViniTou changed the title IBX-12043: Upgrade to Doctrine DBAL 4 [TMP] IBX-12043: Upgraded to Doctrine DBAL 4 Aug 7, 2026
ViniTou added 2 commits August 7, 2026 08:42
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.
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.
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.

3 participants