-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Address deprecations from doctrine/dbal #11809
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.
$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).
No description provided.