-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Address deprecations from doctrine/dbal #11809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.3.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@morozov am I on the right track with this? It seems a bit complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand, you want to create wrapper classes that will expose some unified interface for DBAL 4 and 5. That looks about right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a second thought, is it really necessary for ORM to support DBAL 4.2.x and 5.x? If it bumps DBAL requirement to 4.3.x, then it can switch to the new API without the need to implement the wrapers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue isn't that 4.2.x needs to be supported (otherwise indeed I would bump), the issue is that 3.x needs to be supported 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's something fundamentally wrong with this requirement.
DBAL deprecates its old APIs and provides a forward compatibility layer exactly in order to help its consumers migrate from one major release to the other (two in total) w/o building any compatibility layers themselves. ORM, on the other hand, aims at supporting 3 major DBAL releases (3 through 5) and thus has to maintain its own compatibility layer.
Maybe instead of building a compatibility layer, this effort could be spent on dropping support for DBAL 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If #11216 was back ported in should probably land in 3.4 though but not in a 3.3 patch release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, and technically, I'd say so do deprecations, because addressing them does not make the software more stable (and at the time the software was originally written, there was nothing wrong with it at all).
$namesAsStrings = []; | ||
|
||
foreach ($this->foreignKey->getReferencingColumnNames() as $name) { | ||
$namesAsStrings[] = $name->toSQL($platform); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I maybe be using toString
here? I fear that the platform won't be always available in places where I should use these methods, for instance here:
orm/src/Mapping/Driver/DatabaseDriver.php
Line 210 in cf39e00
$localColumn = current($myFk->getLocalColumns()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to represent names as strings for compatibility with DBAL 4, then toString()
is fine. The contract is: toSQL(AbstractPlatform)
will render the name so that it can be parsed by the platform in question; toString()
will render the name so that it can be parsed by the corresponding name parser (i.e. converted back to object).
@@ -25,7 +25,7 @@ | |||
"composer-runtime-api": "^2", | |||
"ext-ctype": "*", | |||
"doctrine/collections": "^2.2", | |||
"doctrine/dbal": "^3.8.2 || ^4", | |||
"doctrine/dbal": "4.3.x-dev", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not convinced that dropping support for older DBAL releases is a good idea to do in a patch release
No description provided.