[TMP] IBX-12043: Upgraded to Doctrine DBAL 4 - #39
Open
ViniTou wants to merge 2 commits into
Open
Conversation
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.
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:
Part of the staged Doctrine upgrade under IBX-12043. Two DBAL 4 removals drive everything here.
First, binding types became enums.
Connection::ARRAY_PARAM_OFFSETis gone, so theParameterType+ offset arithmetic that turned a scalar binding type into an array one has to be replaced by a mapping ontoArrayParameterType. That mapping lives next to the existing lookup asDoctrineSchemaMetadata::getArrayBindingTypeForColumn(), andgetBindingTypeForColumn()now returnsParameterTyperather thanint— a signature change onDoctrineSchemaMetadataInterface, which is public API.Parameterwidens 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 viaJoinedTablesTracker, 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()throwsQueryExceptionwhen 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 whosefromAliasis not a registered FROM/JOIN alias now throwsUnknownAlias.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
INcomparisons, which are the array-binding path.Documentation:
N/A