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

Use the DsnParser to handle the url option #1669

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

stof
Copy link
Member

@stof stof commented Jun 5, 2023

The DsnParser tool is used in the ConnectionFactory to support the url option (the processing is done in the same way than the deprecated logic in DBAL's DriverManager).

As the goal of Symfony is to be compatible out-of-the-box with cloud providers, we always register a default mapping of schemes to DBAL drivers instead of forcing to use DBAL driver names directly, as this is unlikely to happen. For instance, the Postgresql project defines URI-based connection strings that can use postgres or postgresql as scheme, so cloud providers that are not tied to Doctrine DBAL only will use one of those for sure. But DBAL has drivers named pgsql and pdo_pgsql depending on the extension name. However, unlike the old DBAL logic which forced the choice of which of the drivers is used for those standard schemes (which was the reason to deprecate those aliases in DBAL itself in favor of a configurable DsnParser), the bundle allows to configure the driver used for each scheme. The configured schemes are merged with the default map (and they win over our default map).

Closes #1665

@stof stof added this to the 2.10.0 milestone Jun 5, 2023
@stof stof force-pushed the use_dsn_parser branch from 1e404b1 to 65b0b92 Compare June 5, 2023 13:28
@stof stof force-pushed the use_dsn_parser branch from 65b0b92 to 11f270c Compare June 5, 2023 13:36
@stof stof merged commit e1f961a into doctrine:2.10.x Jun 5, 2023
@stof stof deleted the use_dsn_parser branch June 5, 2023 14:17
@MrMitch MrMitch mentioned this pull request Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants