Skip to content
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

Add doctrine/dbal 3 support #8347

Closed
wants to merge 1 commit into from
Closed

Conversation

acasademont
Copy link
Contributor

@acasademont acasademont commented Nov 24, 2020

Hi all,

This is a first attempt into having DBAL 3 support on the 2.x ORM branches. There are some things that should we discussed, namely:

  • Some Platforms do no longer exist on DBAL (PostgreSqlPlatfrom, PostgreSql91Platfrom, PostgreSql92Platfrom, SQLServerPlatform, SQLServer2005Platform, SQLServer2008Platform). As DBAL is most of the times fetched as a dependency of ORM this can be a problem if someone still relies on those platforms. Not sure if this should be considered a BC-break, and hence DBAL 3 would not be possible on ORM 2. Some tests that relied on those platforms have then changed.

  • Some methods that the ORM uses are no longer present on DBAL 3, namely AbstractPlatform::prefersSequences(), AbstractPlatform::getSQLResultCasing() and AbstractPlatform::fixSchemaElementName(). For prefersSequences I think I have found an acceptable workaround that should not break anything. For getSQLResultCasing I have created a new SQLResultCaser class to do it, same with fixSchemaElementName() and a new SchemaElementNameFixer. See the discussion with @morozov on Deprecate more AbstractPlatform methods dbal#4229

  • Should we trigger deprecation warnings somewhere?

Tests pass with both DBAL 2 and DBAL 3. I have raised the minimum DBAL version to 2.12.

@acasademont
Copy link
Contributor Author

The discussion and PR about the LockModes in DBAL is also relevant here, I had to do some magick tricks to make the tests pass in both DBAL 2 and 3

#8341

@@ -91,13 +91,16 @@ public static function createApplication(HelperSet $helperSet, array $commands =
*/
public static function addCommands(Application $cli) : void
{
$cli->addCommands(
[
if (class_exists(DBALConsole\Command\ImportCommand::class)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the ORM expose DBAL console commands? The new commands are not really compatible, not sure how to make them.

@acasademont acasademont force-pushed the dbal3 branch 2 times, most recently from a5b0ed9 to e609b67 Compare November 24, 2020 15:33
@acasademont
Copy link
Contributor Author

Also DBAL removed the $_attributes array of the ORM\Configuration object, we should decide if we want to keep using our own private $_attributes property or do the same as DBAL and move everything to individual properties, with the BC-Break that exists if someone was extending that Configuration class.

$this->_attributes['proxyDir'] = $dir;

@acasademont
Copy link
Contributor Author

Also, PHP was bumped to 7.3 in order to support DBAL 2.12

@acasademont
Copy link
Contributor Author

Also, the MySqlPlatform was renamed to MySQLPlatform, not sure the impact this can have on case-sensitive filesystems.

@beberlei
Copy link
Member

beberlei commented Nov 24, 2020

@acasademont this is something we want to do ourselves to learn from the API changes. I would advise not to put too much work into this before we map this out, sorry :-(

Edit: Also we don't want to support DBAL 3 in ORM 2, we will branch of ORM 3 of 2.* soon master will need to become ORM 4/NEXT.

@acasademont
Copy link
Contributor Author

@beberlei sure! I just wanted to give it a first try, happy to help you in any way I can. I think it's a good idea to branch ORM 3 and put DBAL support there.

@PowerKiKi
Copy link
Contributor

@beberlei, I couldn't find any other issue talking about DBAL 3.0 support. Should we create an issue for it in milestone 3.0.0 and close this PR ? or should we track progress through this existing PR ?

@greg0ire
Copy link
Member

Closed by #8964

@greg0ire greg0ire closed this Sep 10, 2021
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.

4 participants